Try what you had before:
 
Select * FROM tblEvents
WHERE DateDiff(d, GETDATE(), estarttime) >= 7

There is no CF in this query, therefore no need for pound signs.

This should work for SQL2K.

Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy 
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com

-----Original Message-----
From: Scott Wilhelm [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2003 10:26 AM
To: CF-Talk
Subject: RE: Deleting items older than 7 days from today

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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

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

Reply via email to