A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query All records except latest



 
 
Thread Tools Display Modes
  #1  
Old March 23rd, 2010, 07:11 PM posted to microsoft.public.access
deb
external usenet poster
 
Posts: 898
Default Query All records except latest

Access 2003

I need to limit my query to ALL RECORDS EXCEPT the most current record.

Any ideas on how to do this
--
deb
  #2  
Old March 23rd, 2010, 07:20 PM posted to microsoft.public.access
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Query All records except latest

Deb -

It will look something like this, assuming no more than one record per date
per key field. You can adjust to use date/time if that is needed. It
depends on what makes your records unique. Try something like this,
substituting your table and fieldnames...

Select myKeyfield, field1, field2, field3, myDate
FROM myTable
Where myDate (Select max(myDate) from myTable AS T2 WHERE T2.myKeyfield =
myTable.myKeyfield)

--
Daryl S


"deb" wrote:

Access 2003

I need to limit my query to ALL RECORDS EXCEPT the most current record.

Any ideas on how to do this
--
deb

  #3  
Old March 23rd, 2010, 07:55 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query All records except latest

On Tue, 23 Mar 2010 12:11:02 -0700, deb wrote:

Access 2003

I need to limit my query to ALL RECORDS EXCEPT the most current record.

Any ideas on how to do this


Access does not know or care which is "the most current" record. You'll have
to define the criteria for that yourself, based on the structure of the table
and the nature of the data. Do you have a sequential ID, or a date/time stamp,
or something else which would let you identify the "current" record?
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.