[thelist] ASP & SQL SELECT Query - comparing dates

Elfur Logadottir elfur at members.evolt.org
Tue Apr 10 10:06:51 CDT 2001

Hi, evolters

I have a problem with my SELECT query when comparing dates.

I have a table with three fields, ID, date and content and I want to
make a query from it, selecting only the records that are on the most
recent date.

There are two unknown factors here:
- I don't know the most recent date
- I don't know how many records are with that date.

so I start by finding the most recent date:

strSQL ="select TOP 1 date from table order by date desc"

and this works just fine, returns the date of the most recent record
in that table.

Next I have to find all the records with said date >> and enters the
I thought I would be able to do

strSQL2 ="select * from table where date like " & strSQL & " order by
time desc"

but no such luck.
how do I have to do this?

if it matters, the db is MS Access 2000

*the silent one*

More information about the thelist mailing list