Click here to Skip to main content
15,880,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using sql server, in that using query how to get the next day date in the sql server.

if suppose 7/4/2013

i want the output as follows 8/4/2013.

how can i get the above output using sql server.

Please help me

Regards
Narasiman P
Posted

Do this:
DATEADD(day, 1 , "your date" )
 
Share this answer
 
Solution1 (by richcb) is very good, but i want to show you little trick. Of course, you can use DATEADD[^] function, but see below example:
SQL
DECLARE @myDate DATETIME

SET DATEFORMAT dmy;

SET @myDate = '07/04/2013'

SELECT @myDate AS MyDate1, DATEADD(dd,1,@myDate) AS MyDate2, @myDate + 1 AS MyDate3

The same you can achieve using simply + 1.
 
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