Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello

I want to know the code for getting the data for day before today in todate column.

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 13-Jun-12 1:27am
v2
Comments
OriginalGriff 13-Jun-12 7:27am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

Use the SQL DATEADD function: w3schools[^]

Set the Datepart to "day", and the number to "-1"
 
Share this answer
 
Write the query in the following manner:

select dateadd(day, -1, getdate());

You can get additional information from
http://msdn.microsoft.com/en-us/library/ms186819.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900