The shipdate is an ODBCDateTime. I tried #CreateODBCDateTime(yearback)# and it still doesn't work.
-----Original Message----- From: Byron M [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 12:58 PM To: CF-Talk Subject: Re: Date Comparison I trust that the shipdate field in your db is a datetime data type. If so this should work. WHERE customer_orders.shipdate > #CreateODBCDateTime(yearback)# Byron Mann ----- Original Message ----- From: "Chris" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 12:25 PM Subject: Date Comparison > I'm trying to grab all records in a table that were created within the > last year. I started by creating a variable called yearback. > > > > <CFSET yearback=#DateAdd('yyyy', -1, NOW())#> > > > > this is my SQL where clause > > > > WHERE customer_orders.shipdate > #yearback# > > > > Problem is, some of the ship dates are just dates, which work fine, and > others are DateTime. My query returns nothing if the record I'm looking > for contains a DateTime. How do I work around this? > > > > Thanks > > Chris > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq 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