Solved

SELECT LAST problem

Posted on 2011-03-09
6
263 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

734 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