Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

21 days ago....?

Status
Not open for further replies.

Extras

Technical User
Joined
Nov 16, 2001
Messages
232
Location
US
How do I do a comparison to pull out the day values (Article_Date) that are less than 21 days ago?

Article_Date is an ODBC date field in Access

For example I have the following code...

<CFSET Today_date = Now()>

<cfset Cutoff_date = (#Today_date# - 21)>

CFQUERY NAME=&quot;Latest_Article&quot; DATASOURCE=&quot;Test&quot;>
SELECT *
FROM Articles
WHERE (Article_Date > #Cutoff_date#
ORDER BY Article_Date, Article_Title
</CFQUERY>

<cfoutput>#Cutoff_date#</cfoutput>
<cfoutput query=&quot;Release_Display&quot;>
#Article_Title
</cfoutput>

I get a really odd output for the #Cutoff_date# value - it is something like...37289.517338

Any help on approaching this would be appreciated...

ds
 
Thanks all - I got this one solved..just used the following..

<CFQUERY NAME=&quot;Latest_Article&quot; DATASOURCE=&quot;PRTest&quot;>
SELECT *
FROM Articles
WHERE DATEDIFF('y',Article_Date , Now()) < 21
ORDER BY Article_Date , Article_Title
</CFQUERY>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top