Another CFMLish option: couponstartdate <= #CreateODBCDateTime(CreateDateTime(DatePart("yyyy", Now()), DatePart("m", Now()), DatePart("d", Now()), 23, 59, 59))# and couponenddate >= #CreateODBCDateTime(CreateDateTime(DatePart("yyyy", Now()), DatePart("m", Now()), DatePart("d", Now()), 0, 0, 1))#
On Mon, Dec 1, 2008 at 9:10 AM, Dawson, Michael <[EMAIL PROTECTED]> wrote: > I would do something like: > > WHERE datetime BETWEEN CAST(FLOOR(CAST(couponstartdate AS float)) AS > datetime) > AND CAST(FLOOR(CAST(couponenddate AS float)) AS datetime) > > -----Original Message----- > From: Will Tomlinson [mailto:[EMAIL PROTECTED] > Sent: Monday, December 01, 2008 9:05 AM > 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. > > > > So then I write it like this? > > AND datetime >= couponstartdate and datetime <= couponenddate > > Thanks! > > 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:316066 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4