on 11/8/00 11:39 PM, W Luke at [EMAIL PROTECTED] wrote:

> I'm trying to query my DB to match records against the current month.  I
> need to use the #month# syntax against one of the tables in my DB but it's
> producing a load of errors:
> 
> <cfset today = #createODBCDate(Now())#>
> 
> <cfquery name="ad_number" datasource="localads">
> SELECT * from advert_details WHERE #month(start_date)# = #month(today)#
> </cfquery>
> 
> Can anyone point out where I'm going wrong..?

Seems you're trying to use the SQL date functions, but you have them
surrounded by # symbols so CF is interpreting them as CF functions.

Try:

<cfquery name="ad_number" datasource="localads">
SELECT * from advert_details WHERE month(start_date) = month(now())
</cfquery>

-- 

Rob Keniger

big bang solutions

<mailto:[EMAIL PROTECTED]>
<http://www.bigbang.net.au>

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to