Thanks Pascal.

J



-----Original Message-----
From: Pascal Peters [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 2:02 PM
To: CF-Talk
Subject: RE: T-SQL


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



______________________________________________________________________
Dedicated Windows 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=coldfusiona
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

Reply via email to