They should both work, but you are using ( instead of , in the 2nd datepart on each line.
-----Original Message----- From: John McCosker [mailto:[EMAIL PROTECTED]] Sent: vrijdag 8 februari 2002 14:50 To: CF-Talk Subject: T-SQL HiYa, Does anyone know the equivalent to this in t-sql DATEPART(HH, DT), this doesn,t work and neither does this DATEPART(HOUR, DT) its for a stored proc, this is what I want to do, SELECT * FROM AbbeyFealeAlerts WHERE DATEDIFF(DAY,dt,GETDATE()) >= @DateTo AND DATEDIFF(DAY,dt,GETDATE()) <= @DateFrom AND DATEPART(HH, DT) >= DATEPART(HH(@TimeFrom) AND DATEPART(HH, DT) <= DATEPART(HH(@TimeTo) ORDER BY DT DESC Thanx in advance ______________________________________________________________________ Why Share? Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

