Forums

This topic is locked

SELECT WHERE DATE ?

Posted 23 Nov 2001 12:18:18
1
has voted
23 Nov 2001 12:18:18 Stephen Bateman posted:
Can anyone help me out with selecting a recordset based on a date field "EXPIREDATE" in yyyy-mm-dd format.

What I want to do is check to see if the "EXPIREDATE" on a record is older than today and if so not display the record.

I know how to do a basic SELECT WHERE bu not sure how to deal with the "-" in between the year, month and day.

Any help appreciated.

GT

Replies

Replied 23 Nov 2001 20:25:54
23 Nov 2001 20:25:54 Owen Eastwick replied:
Something like:

SELECT *
FROM YourDatabaseTable
WHERE ExpireDate > Now()

If you need to muck about with date formats go to:

msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/728/msdncompositedoc.xml&frame=true

Download the Windows Script Documentation, this is an installable help file, which no web developer should be without.

When you've downloaded and installed the help file take a look at the FormatDateTime and SetLocale functions and the LCID - Locale ID regerence.

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic