In MS-SQL you could use:
WHERE DATEDIFF(d,cast(cast(tmonth as varchar) + '/' + cast(tday as varchar)
+ '/' + cast(tyear as varchar) as datetime),getDate()) <= 7
-----Original Message-----
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 12:20 PM
To: CF-Talk
Subject: last 7 days
Trying to post some results to a CF report that I built, but I can't think
of a way to poll the database for any records on the last 7 days to present
in the report.
so far I have:
<cfquery name="dayData" datasource="#DSN#">
SELECT *
FROM outageReport
WHERE tMonth LIKE '#url.month#'
AND tDay LIKE <!-- ok, this is the part I can't figure out... I need to
get the last 7 days including today here... -->
</cfquery>
I just save the day/month/year info in different columns in the database, so
tDay would look like 27 for today, tMonth 3, tYear 2001.
thanks for any help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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