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
-
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
3 hours, 57 minutes ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
1 hour, 17 minutes ago -
Small desktops
by
Susan Bradley
1 hour, 22 minutes ago -
Totally disable Bitlocker
by
CWBillow
2 hours, 19 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
1 hour, 34 minutes ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
1 day, 7 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
1 hour, 30 minutes ago -
Mystical Desktop
by
CWBillow
1 day, 11 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
16 hours, 30 minutes ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
3 hours, 7 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
2 days, 2 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
2 days, 5 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
2 days, 3 hours ago -
What is wrong with simple approach?
by
WSSpoke36
1 hour, 25 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
2 days, 14 hours ago -
Location, location, location
by
Susan Bradley
1 day, 5 hours ago -
Cannot get a task to run a restore point
by
CWBillow
2 days, 16 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
2 days, 6 hours ago -
June 2025 Office non-Security Updates
by
PKCano
3 days, 2 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
1 day, 5 hours ago -
Firefox Red Panda Fun Stuff
by
Lars220
3 days, 2 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
3 days, 13 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
2 days, 15 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
3 days, 21 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
3 days, 21 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
3 days, 11 hours ago -
Firefox 139
by
Charlie
3 days, 4 hours ago -
Who knows what?
by
Will Fastie
2 days, 6 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
9 hours, 13 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 day, 16 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.