You can use the createTimeSpan function in CF

<cfset MyTime=TimeFormat(Now()- CreatetimeSpan(0,1,0,0),"HH:MM")>

This will create a Time that is hour less than current time.

Is CreateDate a DB Date field? or just an Number? Becasue if it is you will
need to use the CreateodbcdateTime instead of TimeFormat. and omit the Time
format at the end.

HTH

Jason Lees
National Express Ltd
E-Mail : [EMAIL PROTECTED]


-----Original Message-----
From: Kevin Davis [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2001 15:59
To: CF-Talk
Subject: one hour query


Is it possible to write a query that retrieves data from the data source for
the last hour?

for Ex...

<CFQUERY name="name" datasource="#ds#">
Select * from tablename
where fieldname  = fielddata
and createdate >= #Hour(Now())#
and createdate <= #Hour(Now()-1)#
</CFQUERY>

or something like that. (The above query doesn't seem to work for me.)

I have looked though the CF manuals, searched my email achieves and have
been out to Allaires forms site and haven't been able to find anything.  

Any help would be greatly appreciated. 

Thanks,

Kevin Davis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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