How to find previous date in SQL Server

By
Advertisement
To find the previous date in SQL Server below query is used

SELECT * FROM myTable WHERE CrDate < DATEADD(d, -1, GetDate())

The DATEADD(d, -1, GetDate()) function will subtract one from the current date and return the results


In C#.Net we can do it using the below line of code

DateTime.Now.AddDays(-1)



0 comments:

Post a Comment

Online Casino