Solved

SELECT LAST problem

Posted on 2011-03-09
6
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

636 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