Hmm, wild guess, try replacing the double quotes with single quotes.

----- Original Message -----
From: Scott Brady <[EMAIL PROTECTED]>
Date: Tuesday, December 24, 2002 11:36 am
Subject: SQL runs in Access but not CFMX

> I have a query which runs fine in Access (putting the generated 
> SQL into
> Access) but CFMX returns an error.
> 
> Here's the SQL:
> SELECT
>  c.calendar_id,
>  c.startDate,
>  c.endDate,
>  c.frequency_id,
>  f.frequency,
>  c.location,
>  c.description
> FROM
>  calendarTbl c
>   INNER JOIN frequencyTbl f ON c.frequency_id = f.frequency_id
> WHERE
>  (
>   (
>    DatePart("m",c.startDate) = 12
>    AND DatePart("yyyy",c.startDate) = 2002
>   )
>   OR
>   (
>    DatePart("m",c.endDate) = 12
>    AND DatePart("yyyy",c.endDate) = 2002
>   )
>  )
>  AND c.active_cd = 1
> ORDER BY
>  c.startDate,
>  c.endDate
> 
> Here's the error that CFMX returns:
> [MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
> Access Driver] Too few parameters. Expected 2.
> 
>      VENDORERRORCODE   -3010
>      SQLSTATE   07002
> 
> 
> Unfortunately, those error codes mean nothing.  based on taking out
> different parts of the query, it looks like the date function 
> lines int he
> Where clause are to blame, but I can't figure out why 
> (particularly since it
> works in Access).
> 
> Scott
> -------------------------------------------
> Scott Brady
> http://www.scottbrady.net
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to