is logdate a date/time datatype? "W Luke" <[EMAIL PROTECTED]> wrote: That just pulled all the record, irrespective of time...I get the logic, but not why it isn't working. Hmmm. ----- Original Message ----- From: "Alex" <[EMAIL PROTECTED]> Newsgroups: gradwell.lists.cftalk Sent: Wednesday, May 16, 2001 6:52 PM Subject: Re: [Using 'Between' sql for Times/Dates] > try... > where logdate > (now() - 2hours) > > "W Luke" <[EMAIL PROTECTED]> wrote: > 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 > > -- > Will > Free Classifieds -=- www.localbounty.com > e: [EMAIL PROTECTED] icq: 31099745 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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