Previous Date

M

Mark

I'm looking for how to set up a query to return the record with the previous
date to the most recent date. Example:
ReturnDate:
11/15/03
12/12/03
2/4/04
4/5/04

The most recent date is 4/5/04. I need to return the record with 2/4/04.

Thanks!

Mark
 
N

Nikos Yannacopoulos

Mark,

From your phrasing I understand you want to set up a query in design view,
not programatically... which means ve posted to the wrong newsgroup. Anyway,
here it goes:

Make a simple select query on your table. Set the sort order on ReturnDate
to Descending, type the following criterion under ReturnDate:
< DMax("[ReturnDate]","TableName")
substituting TableName with the actual table name, and right-click in the
upper half of the design view (source tables area) to open the query
properties. Change the Top Values property from default All to 1.
You should be ready.

HTH,
Nikos
 
Top