Solved

SELECT LAST problem

Posted on 2011-03-09
6
261 Views
Last Modified: 2013-12-17
(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?
0
Comment
Question by:yaron89
6 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 35081651
this seems to be ms access, and not ms sql server, right?
you might want to use MAX() instead of LAST()
0
 
LVL 9

Expert Comment

by:kaminda
ID: 35081756
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
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35081825
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.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 35083040
>>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.
0
 

Author Closing Comment

by:yaron89
ID: 35083105
Thank you
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question