"datetime" would be your variable or another column to which you would
compare the coupon start/end dates.

Mike 

-----Original Message-----
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 01, 2008 7:00 PM
To: cf-talk
Subject: Re: SQL between dates problem

>If you are using MS SQL...
>
>SELECT CAST(FLOOR(CAST(GETDATE() AS float)) AS datetime)
>
>This will remove any time part from a datetime field.

I'm getting an error from the SQL. I've played around with it with no
luck. 

SELECT couponpercdisc, CAST(FLOOR(CAST(GETDATE() AS float)) AS datetime)
FROM tblCoupons WHERE couponcode = <cfqueryparam
value="#arguments.couponcode#" cfsqltype="cf_sql_varchar"> AND datetime
BETWEEN CAST(FLOOR(CAST(couponstartdate AS float)) AS datetime) AND
CAST(FLOOR(CAST(couponenddate AS float)) AS datetime)

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name
'datetime'


Will 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316107
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to