Ok, I think I've found it in my BOL docs...Try this: SELECT * FROM tblEvents WHERE DATEDIFF(d, estatetime, #DATEFORMAT(NOW())#)
HTH > -----Original Message----- > From: Angel Stewart [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 9:53 AM > To: CF-Talk > Subject: RE: Deleting items older than 7 days from today > > > Ehmm...now I get the error that GetDate can't resolve. > > I'm using your exact syntax for the datediff statement. I saw that I > used "dd" Instead of 'd' at first..so I changed that. > But it still doesn't help. > > It seems that within the SQL statement it can't resolve the > SQL field if > I use a CF Function. > > -Gel > > > -----Original Message----- > From: Scott Wilhelm [mailto:[EMAIL PROTECTED] > > Don't use CF for it, let the SQL do the work for you... > > Just setup your SQL statement like this: > > Select * FROM tblEvents > WHERE DateDiff("d", GETDATE(), estarttime) >= 7 > > (Sorry, I referenced NOW() last time...it should be GETDATE()) > > HTH, > > Scott > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

