Try
SELECT facility from YourTable
WHERE audit_date = NULL
AND rcvd_date < #CreateODBCDateTime(DateAdd("d", "-90", now()))#
You may have to tweak the date format (if you're not using ODBC...).
FYI -- this is untested code...
Jeff
-----Original Message-----
From: Tim
To: CF-Talk
Sent: 5/10/01 8:08 PM
Subject: searching date ranges
I have a database with fields called facility,
rcvd_date and audit_date. I need to query the database
for a user selected facility with a rcvd_date that is
greater than 90 days old and the audit_date field is
blank.
For instance, the user selects Atlanta, and the query
will return all records for Atlanta, where the
rcvd_date is older than 90 days from the current date,
and the audit_date field is blank. So, if a record
for Atlanta has a rcvd_date of 05/01/2001, it would
not be returned, but one with a date of 02/01/2001
would.
I have the facility portion done, but can not figure
out how to search the rcvd_date field to check the
records with dates 90 days old or more. Any ideas?
Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists