Avatar of yaron89
yaron89
 asked on

SELECT LAST problem

(Remark: The question is for experienced experts please do not send googling answers)
I have an mdb table which I check last record by:
"SELECT LAST(user_number) from sw1_users"  
then I Insert a new record  to the table succefully
and check last record again by:
"SELECT LAST(user_number) from sw1_users"
It work fine for a period of time but now I get the same LAST value always.
I tried to delete some last records but it doesent help, it seems that the table is not counting new records.
How can I solve this or check for the source of the problem?
.NET ProgrammingMicrosoft Access

Avatar of undefined
Last Comment
yaron89

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
kaminda

I am not sure why Access has stopped working abruptly. But without relying on this access function you can write some SQL to get the same out put

SELECT TOP 1 user_number from sw1_users ORDER BY user_number DESC
Guy Hengel [angelIII / a3]

explanation: LAST will return the "last record returned", but the rows might not be returned in the order of that field.
so, only MAX() will be the correct approach.
Anthony Perkins

>>Zones: MS SQL Server, Microsoft Visual C#.Net<<
Please request the thread be moved from MS SQL Server to the more appropriate MS Access zone.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
yaron89

ASKER
Thank you