Does anybody have a reference of what database systems support SQL functions
like this?
Thanks in advance
Nathan Nelson
Cold Fusion Developer
..::[CFDynamics]::.
www.cfdynamics.com
[EMAIL PROTECTED]
(801)621-8511
* * You've got to check this out! * *
CFDCalendar http://demo.cfdynamics.com/cfdcalendar/
Online Personal Assistant
-----Original Message-----
From: Andrew Tyrone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 1:55 PM
To: CF-Talk
Subject: RE: Using 'Between' sql for Times/Dates
> -----Original Message-----
> From: W Luke [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 16, 2001 1:34 PM
> To: CF-Talk
> Subject: Using 'Between' sql for Times/Dates
>
>
> Hi,
>
> I have a list of dates and times, in a field called logDate, which are
> constantly updated. I need to pull the last 2 hours worth of
> rows that have
> been added. I think there's a specific part of time-handling that I'm
> missing, because the code below doesn't pull any records at all:
>
> <cfset twohours = #CreateODBCTime(DateAdd("h", -2, now()))#>
> <Cfset nowtime = #CreateODBCTime(now())#>
>
> <Cfquery name="getem" datasource="LBTalk">
> SELECT logDate FROM stats
> WHERE logDate BETWEEN #twohours# AND #nowtime#
> </cfquery>
>
> The Database is Access, and the field is set to General Date.
>
> Any help would be appreciated
You're using CreateODBCTime() where you should be using
CreateODBCDateTime():
<cfset twohours = CreateODBCDateTime(DateAdd("h", -2, now()))>
<Cfset nowtime = CreateODBCDateTime(now())>
Your current code will only return the time part for comparison, not the
actualy date associated with the time.
-Andy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists