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, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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
-
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
6 hours, 33 minutes ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
2 hours, 34 minutes ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
8 hours, 59 minutes ago -
Return of the brain dead FF sidebar
by
EricB
1 hour, 51 minutes ago -
windows settings managed by your organization
by
WSDavidO61
3 hours, 41 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
3 hours, 53 minutes ago -
The local account tax
by
Susan Bradley
1 minute ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
15 hours, 35 minutes ago -
Digital TV Antenna Recommendation
by
Win7and10
8 hours, 7 minutes ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
1 day, 3 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
1 day, 5 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
1 day, 8 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
10 hours, 44 minutes ago -
Steps to take before updating to 24H2
by
Susan Bradley
1 hour, 33 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
15 hours, 10 minutes ago -
Replacing Skype
by
Peter Deegan
3 hours, 44 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 day, 2 hours ago -
Excel Macro — ask for filename to be saved
by
nhsj
1 hour, 26 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
3 hours, 30 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
3 days, 8 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
3 days, 10 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
3 days, 10 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
1 day, 22 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
3 days, 10 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
4 days, 1 hour ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
4 days, 5 hours ago -
Inetpub can be tricked
by
Susan Bradley
2 days, 12 hours ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
2 days, 23 hours ago -
FBI 2024 Internet Crime Report
by
Alex5723
4 days, 9 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 day, 18 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.