During my attempts to upsize our database to SQL and convert our .mdb to a project, I noted another missing function that we use a lot. I can’t find any equivalent to First() or Last(). Any suggestions?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
help with another missing function (Access 2K/SQL 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » help with another missing function (Access 2K/SQL 2000)
- This topic has 10 replies, 2 voices, and was last updated 21 years, 2 months ago.
AuthorTopicViewing 1 reply threadAuthorReplies-
WBell
AskWoody_MVPMarch 31, 2004 at 8:22 pm #807834Are you referring to the DFirst() and DLast() functions? You can get pretty much the same result with a query when you sort it either in ascending order or descending order and then specify the TOP 1 SQL clause. However, if you are using them on a form, it is a more complicated process in a project. Is this an experiment to see if you can make it work, or is that your marching orders?
-
WSgarbsmj
AskWoody LoungerMarch 31, 2004 at 8:54 pm #807868Wendell,
We’re trying to select the first instance of a customer in an aggregate query that’s ideally supposed to make a special table/view. One instance is a cummulative count of outstanding stuff and the other can be left as a view. The two queries I have contain a lot of First(name of field) fields as we’re trying not to duplicate records. Yes, we do have to go to .adp’s. Do you need an example?
-
WBell
AskWoody_MVPApril 1, 2004 at 4:02 am #807990Hmmm Peggy, so these are aggegrate queries and you aren’t really doing a D function – I’ll have to do a bit of digging to see what the TSQL syntax is. But if you simply want to eliminate duplicates, you can use the SELECT DISTINCTROW option in Access queries, so I’m still a little confused – I get that way easily BTW. And it seems to me that TSQL uses a different syntax for DISTINCT, but I don’t remember it. I’ll get back to you on both of those.
My comment on ADPs was based on the fact that development of ADPs, particularly in 2000 is pretty cumbersome – they’ve made it a bit better in 2002, but we still think it takes about twice as long to build a front-end using an ADP as it does to do an MDB that links to SQL tables using ODBC. At one point, Microsoft people in high positions were saying that Jet would go away, and people would only use ADPs, but I only know of a couple of developers who have ever deployed an actual working ADP-based system, and I think current view is that MDB databases will be around for a long time to come. In your case it’s likely you would be taking on city hall, so I understand, but our experience hasn’t been all that favorable. If you want more details on where the difficulties arise, I’ll dig in and put something together.
-
WBell
AskWoody_MVPApril 1, 2004 at 4:02 am #807991Hmmm Peggy, so these are aggegrate queries and you aren’t really doing a D function – I’ll have to do a bit of digging to see what the TSQL syntax is. But if you simply want to eliminate duplicates, you can use the SELECT DISTINCTROW option in Access queries, so I’m still a little confused – I get that way easily BTW. And it seems to me that TSQL uses a different syntax for DISTINCT, but I don’t remember it. I’ll get back to you on both of those.
My comment on ADPs was based on the fact that development of ADPs, particularly in 2000 is pretty cumbersome – they’ve made it a bit better in 2002, but we still think it takes about twice as long to build a front-end using an ADP as it does to do an MDB that links to SQL tables using ODBC. At one point, Microsoft people in high positions were saying that Jet would go away, and people would only use ADPs, but I only know of a couple of developers who have ever deployed an actual working ADP-based system, and I think current view is that MDB databases will be around for a long time to come. In your case it’s likely you would be taking on city hall, so I understand, but our experience hasn’t been all that favorable. If you want more details on where the difficulties arise, I’ll dig in and put something together.
-
WBell
AskWoody_MVPApril 1, 2004 at 2:03 pm #808125OK, after digging through the T-SQL stuff, the best I can find is the Min and Max functions, but the syntax isn’t anything like the way first and last work with GroupBy queries in Access. If your real objective is to not return multiple duplicate records, the DISTINCT keyword as a part of the SELECT clause should do the trick.
-
WBell
AskWoody_MVPApril 1, 2004 at 2:03 pm #808126OK, after digging through the T-SQL stuff, the best I can find is the Min and Max functions, but the syntax isn’t anything like the way first and last work with GroupBy queries in Access. If your real objective is to not return multiple duplicate records, the DISTINCT keyword as a part of the SELECT clause should do the trick.
-
-
WSgarbsmj
AskWoody LoungerMarch 31, 2004 at 8:54 pm #807869Wendell,
We’re trying to select the first instance of a customer in an aggregate query that’s ideally supposed to make a special table/view. One instance is a cummulative count of outstanding stuff and the other can be left as a view. The two queries I have contain a lot of First(name of field) fields as we’re trying not to duplicate records. Yes, we do have to go to .adp’s. Do you need an example?
-
-
WBell
AskWoody_MVPMarch 31, 2004 at 8:22 pm #807835Are you referring to the DFirst() and DLast() functions? You can get pretty much the same result with a query when you sort it either in ascending order or descending order and then specify the TOP 1 SQL clause. However, if you are using them on a form, it is a more complicated process in a project. Is this an experiment to see if you can make it work, or is that your marching orders?
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 hour, 10 minutes ago -
National scam day
by
Susan Bradley
2 hours, 31 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
16 hours, 28 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
17 hours, 48 minutes ago -
Tools to support internet discussions
by
Kathy Stevens
1 day ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
8 hours, 54 minutes ago -
AI is good sometimes
by
Susan Bradley
1 day, 1 hour ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
15 hours, 3 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 1 hour ago -
June KB5060842 update broke DHCP server service
by
Alex5723
1 day, 23 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 3 hours ago -
Excessive security alerts
by
WSSebastian42
18 hours, 40 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
2 days, 13 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
6 hours, 28 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
18 hours, 6 minutes ago -
OS news from WWDC 2025
by
Will Fastie
4 hours, 12 minutes ago -
Need help with graphics…
by
WSBatBytes
1 day, 8 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
3 days, 4 hours ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 3 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 days, 7 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
3 days, 15 hours ago -
Search Forums only bring up my posts?
by
Deo
1 day ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
4 days, 3 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
7 hours, 26 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
26 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
4 days, 14 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
4 days, 15 hours ago -
Disengage Bitlocker
by
CWBillow
4 days, 5 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
4 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.