that is actually what I ended up using pretty much....

<cfquery name="delold" datasource="#request.maindsn#" dbtype="ODBC">
  delete * from tbl_bb_newusers
  where  datejoined < #createodbcdatetime(dateadd("h", -24, now()))#
</cfquery>


good call....

but do you know of a way to do exactly this with a sql statement alone, no
cf vars

...for an access db


----- Original Message -----
From: "Gyrus" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Txuesday, January 14, 2003 10:43 AM
Subject: Re: Delete records older than a certain time frame


> ----- Original Message -----
> From: "Ewok" <[EMAIL PROTECTED]>
> > I've been trying to write a query to delete records older than 24 hours.
I
> > can do it with a loop and a var, but I'm sure there is a way to do it
with
> a
> > single query statement.
> ----------------------------
>
> How about:
>
> <cfquery name="purge" datasource="#request.DB_DSN#"
> dbtype="#request.DB_type#">
>   DELETE FROM tab
>   WHERE  dateJoined < <cfqueryparam
> value="#CreateODBCDateTime(DateAdd('h', -24, Now()))#"
> cfsqltype="CF_SQL_DATE">
> </cfquery>
>
> Gyrus
> [EMAIL PROTECTED]
> work: http://www.tengai.co.uk
> play: http://norlonto.net
> PGP key available
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to