2

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.

John Smith
  • 7,243
  • 6
  • 49
  • 61
W.K
  • 75
  • 2
  • 11

4 Answers4

1

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

John Smith
  • 7,243
  • 6
  • 49
  • 61
1

You can use DATEADD() function. Example:

DATEADD(day,1,StartDate)
John Smith
  • 7,243
  • 6
  • 49
  • 61
Rafat Ahmad
  • 169
  • 1
  • 10
1

Use Dateadd

Dateadd(dd,1,Startdate) as Startdate
0

you can use GETDATE() Also

if your start date is today:

select DATEADD(day,1,GETDATE())

image1

 select convert (varchar, dateadd(DAY,1,getdate()),103)

image2

For specific date use this:

  declare @date as date ='20161027'
  select convert (varchar, dateadd(DAY,+1,@date),103)

image3

Laxmi
  • 3,830
  • 26
  • 30