I just encountered this type of problem,  I'm not sure if you have the same
one as I did, bit I had Access storing my dates with the time, so when I
compared the date alone to the dates in the table it didn't return anything
I had to do a CREAte odbcdatetime and concatenate the time to the date
variable.

-----Original Message-----
From: Christopher Mick [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 12, 2000 12:55 PM
To: [EMAIL PROTECTED]
Subject: Date/Time woes....


Hi all,
I'm using CF 4.5 and Access2000.  When I submit this SQL query it doesnt
seem to want to isolate the dates correctly:

***********************
Select *
>From tbl_OCRlot
Where hnum = 1 OR hnum = 2 OR hnum = 8
AND DateTime >= {d '2000-04-12'}
AND DateTime <= {d '2000-04-13'}
***********************

Is there any reason why this shouldn't work?  Here's the date part of the
query in CF:

***********************
AND DateTime >= #createODBCdate(now())#
AND DateTime <= #createODBCdate(createODBCdate(now()) +
CreateTimeSpan(1,0,0,0))#
***********************

Is this createODBCdate() function useable with Access?  I tried to achieve
the desired results in Access and was only able to separate dates out when I
used this format:

***********************
WHERE ((([tbl_OCRlot]![DateTime])>=#4/4/2000# And
([tbl_OCRlot]![DateTime])<=#4/5/2000#))
***********************


Here's a post I read which somewhat covers this:

***********************
>> I never had much luck with #CreateODBCDate(***)#
>> because it appends
>> these brackets { t '               '} and MsSQL7 and Access
>> freak out!! So I just did something like the above for a
>> quick workaround and never got around asking how you correctly
>> use the ODBCDate functions. I guess now is as good a time as
>> ever, anyone????

>ODBC date and time formats use the curly brackets you mention above. To
>reference values in ODBC date/time format in your CFQUERY tags, just leave
>off the single quotes that you'd use for strings.

>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>voice: (202) 797-5496
>fax: (202) 797-5444
***********************


I am not sure I understand what Dave is talking about,...can anyone
elaborate?


TIA,
Chris


----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/cf_talk or send
a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to