[Top] [All Lists]

Re: SQL Between dates

Subject: Re: SQL Between dates
From: "Dan Bracuk"
Date: Tue, 17 Jun 2008 21:52:20 +0000 UTC
Newsgroups: macromedia.coldfusion.advanced_techniques
[q][i]Originally posted by: [b][b]projectproofing[/b][/b][/i]
 That is what I thought. The toDate is a date/time. How can I cast the 
arguments as date. I tried CAST(#arguments.startDate# AS Date) but it exploded.

 Oddly TODATE >= #arguments.startDate# works, but <= #arguments.endDate 
 If it were me, I'd use createdate and the necessary string functions to create 
date variables in the calling template and pass these date variables to the 

 On a related notes, for timestamp fields, it is often better to do this:
 where somefield >= date1 and somefield < date2

 than it is to use between because of the time portion of the field.

<Prev in Thread] Current Thread [Next in Thread>