WHERE A.Selected=1 AND A.EndDate Is Null OR A.Enddate >= GETDATE()
Thanks,there are convert functions with codes like 410,411...etc am not xactly sure which one it is..may be if yo google around you can get the snippet of code...
another way you can also try
WHERE A.Selected=1 AND A.EndDate Is Null OR
(
datepart(m,A.Enddate) >= datepart(m,GETDATE()) and
datepart(d,A.Enddate) >= datepart(d,GETDATE()) and
datepart(y,A.Enddate) >= datepart(y,GETDATE())
)
hth
No comments:
Post a Comment