if you are using SQLServer you can use

WHERE datediff('d',close_date, getdate()) > = 5

You cant use CF functions directly in SQL statements unless you use the #
symbols

HTH,
Duane

-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 2:40 PM
To: CF-Community
Subject: Using DateDiff within SQL..


Hi..

Real quick question..

Why does this give an error?

<CFQUERY name="GetExpiredBids" datasource="#DSN#">

        Select close_date,bidid From tblBids

        WHERE datediff('d',close_date, now()) > = 5


</CFQUERY>

The error is
Error resolving parameter CLOSE_DATE

Yes, Close_Date is within tblBids.

-Gel



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5

Reply via email to