Oh yeah, if you really want to use a date (not sure if there was
more to that question) you could do something like
AND DateField BETWEEN
<cfqueryparam cfsqltype="cf_sql_date"
value="#createODBCDateTime(url.archive& '-01-01 00:00:00')#">
AND
<cfqueryparam cfsqltype="cf_sql_date"
value="#createODBCDateTime(url.archive& '-12-31 23:59:00')#">
Or some such. Cleaner/different ways of doing it too- depends on what
you're after/need.
On 2/20/07, Dinner <[EMAIL PROTECTED]> wrote:
>
> On 2/20/07, Casey Dougall <[EMAIL PROTECTED]> wrote: ...
>
> > AND YEAR(DateField) = <cfqueryparam cfsqltype="cf_sql_varchar"
> > value="#URL.Archive#">
>
>
> YEAR() doesn't return a date-- you know that, right?
>
> mysql> *SELECT YEAR('98-02-03');*
> -> 1998
>
> Is there anything else I can use here? I want to use "cf_sql_date" I've
> > tried doing createdate, datepart and the like, the query returns no
> > results
> > unless I run it as cf_sql_varchar or no queryparam at all.
>
>
> The issue here, is if you want to use a date, use a date.
> IE: You're trying to use a string (year()). That's why only string
> datatypes
> will work. =]
>
> Seems kinda odd but then again, the dam date field in mysql is wack
> > anyway.
> > I'm always having troubles with it and checking mysql documentation
> > never
> > helps, its like it was made by monkeys.
>
>
> I've had no more trouble with MySQL dates than with any other. *shrug*
>
> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
>
> Is what I use, when I need it, and it's always been clear as day. =-/
>
> I am pretty monkey-ish tho.
> Hey hey =]
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270264
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4