1) have you tried outputting the D1 and D2 to see if they're formatted
correctly?
2) is there a problem with date being a reserved word?
3) why don't you use the CreateODBCDate() function? at least it would put
the date in the proper format for sure.

----- Original Message -----
From: "Erik S. Nachbahr" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 25, 2001 11:30 PM
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?�oz˱�m�Y� ����*r?Sw�Dz'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