Whoops,
syntax error,

thats what the reason was,

        SELECT *
        FROM            AbbeyFealeAlerts
        WHERE           DATEDIFF(DAY,dt,GETDATE()) >= @DateTo
        AND             DATEDIFF(DAY,dt,GETDATE()) <= @DateFrom
        AND             DATEPART(HOUR, DT) >= DATEPART(HOUR,@TimeFrom)
        AND             DATEPART(HOUR, DT) <= DATEPART(HOUR,@TimeTo)
        ORDER BY DT DESC

mmm.

-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 1:50 PM
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


______________________________________________________________________
Get Your Own 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=coldfusionb
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