W.K W.K - 1 month ago 8
SQL Question

SQL add one day to start date

I have the following

select
statement that display the start date to end date information. I would like to add one day to the "start date". That means instead of 27/10/2016. It will be come 28/10/2016.

CONCAT(FORMAT(sc.StartDate,'dd/MM/yyy'), + ' - ' + FORMAT(sc.ENDDate,'dd/MM/yyy')) SIPDate


I'm using SQL server 2014.

Answer

With the DATEADD function:

CONCAT(FORMAT(DATEADD(dd,1,sc.StartDate),'dd/MM/yyy'), + ' - ' + FORMAT(sc.ENDDate,'dd/MM/yyy')) SIPDate

MSDN reference:

https://msdn.microsoft.com/en-us/library/ms186819.aspx