Click here to Skip to main content
16,016,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I need to calculate the date difference

startdate - Today =15 days

datediff (day,startdate,getdate()) Then



how to get 15 days before date from today

help pl

regards,
Praveena
Posted
Comments
Uday P.Singh 26-Jul-11 4:25am    
your question is not clear, what are you trying to achieve?

This[^] shoul help.

This is the top level of the above link[^]

It is quite comprehensive, should be able to give all you need.
 
Share this answer
 
This is no technical, but logical.

SQL
DECLARE @Today DATETIME, @OldDate DATETIME
SET @Today = GETDATE()
SET @OldDate = @Today - 15
PRINT @OldDate
 
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