[thelist] ASP & SQL SELECT Query - comparing dates

Don Makoviney DonM at allensysgroup.com
Tue Apr 10 10:19:06 CDT 2001


Even better than Bob's answer would be:

select * from table
where date is (select max(date) from table)
order by time desc

Also, you might want to try ASPLISTS.com in the future as well. . .they have
special lists for queries in ASP, ASP Databases, etc. . . .real helpful (not
arrogant) help on there - very experienced developers.

(Not that the people on this list aren't great too. . . ;-))

http://www.asplists.com/asplists/aspfreeforall.asp

HTH,

Don



-----Original Message-----
From: Bob Davis [mailto:bobd at members.evolt.org]
Sent: Tuesday, April 10, 2001 11:12 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ASP & SQL SELECT Query - comparing dates


Hi Elfur!

On Tuesday, April 10, 2001, at 11:08 AM, Elfur Logadottir wrote:

> strSQL2 ="select * from table where date like " & strSQL & " order by
> time desc"
>
> but no such luck.
> how do I have to do this?

You could try a sub query.

select * from table
where date is (select TOP 1 date from table)
order by time desc

NB:  I haven't tested this, and it's been a little while since I did any 
sql work, so it might not be 100% correct...

bob

--
bob davis
bobd at members.evolt.org

---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list