try this to set your variables instead:

<cfset D1 = "createODBCdate('#userYear#-#userMonth#-#userDay#')">
<cfset D2 = "createODBCdate('#userYear#-#userMonth#-01')">

I'm not entirely sure about it, but I had a similar problem a while back and
this made the difference.


----- Original Message -----
From: "Erik S. Nachbahr" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 7:30 AM
Subject: Query Using Date - Please HELP!!


>
>
>
> Greetings All!
>
> I am crazy, what am I doing wrong here. I want to Run a query on
> an access date/time field. I want to generate the dates to query with
> myself
>
> This code Works........
>
> SELECT
> Sum(ToyotaExtra_Daily) AS ToyotaExtraTotal,
> Sum(Extended_Daily) AS ExtendedTotal
> FROM    SFI
> Where Date between {d '2001-01-26'} and {d '2001-01-25'}
>
> However, what I want to do is something like this:
>
> Create two dates based on user form data
>
> <cfset D1 = "{d '#userYear#-#userMonth#-#userDay#'}">
> <cfset D2 = "{d '#userYear#-#userMonth#-01'}">
>
> And then invoke them in my query:
>
> SELECT
> Sum(ToyotaExtra_Daily) AS ToyotaExtraTotal,
> Sum(Extended_Daily) AS ExtendedTotal
> FROM    SFI
> Where Date between #D1# and #D2#
>
> I get an error when I try the second method!
>
> Please cc [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> as I get the list in digest
> thanks!
>
> �S�?����f.�?+r?q�-H��}�S?�o�z�>���m�m�Y�� !�����*'r?�Sw^���'^m�-+


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to