Rick,

You might find that you can use :

Year(EventDate) = #Year(Now())#

rather than

EXTRACT (YEAR FROM EventDate) = <cfqueryparam cfsqltype="cf_sql_integer"
value="#Year(Now())#">

Depends on the database you're using.

You can use the cfqueryparam in both versions of the SQL statement. Just
thought I'd get rid of it as Year(Now()) will return an integer.

Regards

Stephen

----- Original Message -----
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, February 05, 2003 2:45 PM
Subject: Re: Simple Query Help


> <cfquery name="Q_Month" datasource="command_calendar">
> SELECT
> Title,
> Details,
> EventDate,
> StartHour,
> StartMin
> FROM
> Events
> WHERE
> EXTRACT (YEAR FROM EventDate) = <cfqueryparam
> cfsqltype="cf_sql_integer" value="#Year(Now())#">
> AND
> EXTRACT (MONTH FROM EventDate) = <cfqueryparam
> cfsqltype="cf_sql_integer" value="#Month(Now())#">
> ORDER BY
> EventDate ASC
> </cfquery>
>
> Jochem
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to