SQL Date question -
07-03-2004
, 09:54 PM
Hi,
I have the follwing sql, the problem is that I am trying to bring up all
records which date is equal to getdate().
The problem seems to be that the "date" which is a timedate field compares
getdate and the time too, do I dont get any matches. How can I compare the
dates only ?
SQL:
Select
a.Id, a.CaseId, a.AlienId, b.UserId, b.FirstNm,
b.LastNm,a.Process,a.Processstep,c.ProcesscatalogI d,c.Processcatalog,d.Proce
ssstepId,d.Processtep, d.TimeFrame, d.EmailAlert, a.Processdateupdate,
DATEADD(day,d.Timeframe , a.Processdateupdate ) AS Datedue
from cases as a
LEFT JOIN Users b ON a.AlienID = b.UserID
INNER JOIN Processcatalog c ON a.Process = c.ProcesscatalogID
INNER JOIN Processstep d ON a.Processstep = d.ProcessstepId
INNER JOIN atts e on a.id = e.caseid
WHERE a.Firmid = 2 AND (DATEADD(day,d.Timeframe,a.Processdateupdate ) =
getdate())
Help Appreciated,
Z |