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, 1 month 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
-
Sometimes I wonder about these bots
by
Susan Bradley
3 hours, 30 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
9 hours, 35 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
10 hours, 35 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
10 hours ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
6 hours, 30 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
13 hours, 17 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
13 hours, 18 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
1 hour, 52 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
21 hours, 26 minutes ago -
0Patch, where to begin
by
cassel23
15 hours, 28 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 11 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
22 hours, 49 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 19 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 10 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
21 hours, 43 minutes ago -
Installer program can’t read my registry
by
Peobody
4 hours, 23 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 8 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 15 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 6 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 15 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 17 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
3 hours, 39 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 20 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
3 hours, 58 minutes ago -
Outdated Laptop
by
jdamkeene
3 days, 1 hour ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 7 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 7 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
9 hours, 12 minutes ago -
May 2025 updates are out
by
Susan Bradley
10 hours, 54 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 13 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.