Below is the query to get Yesterday date in sqlserver.
Select *
from table
where DATEPART(dd,creationdate) = datepart(dd,dateadd(dd,-1,getdate()))
and datepart(mm,creationdate) = datepart(mm,dateadd(dd,-1,getdate()))
and datepart(yyyy,creationdate) = datepart(yyyy,dateadd(dd,-1,getdate()))
No comments:
Post a Comment