8

I need add +1 Day, to a selectec Date, in Slq the sintax is: SELECT DATEADD(day,+1, period.DateEnd) and it works, but in sqLite es different.

I try with this, but it doesn't work, for example, the DateEnd = '31/12/2012', I need add 1 day to that date, te resulset should be: DateEnd = '01/01/2013'

  SELECT date('period2.DateEnd', '+1 day') as date 
  FROM Period as period2 
  WHERE period2.c_Pk_CodPeriod = '1012'
ale
  • 3,301
  • 10
  • 40
  • 48
  • Use this link, it will tell you about the Addition / Subtraction of days in date, conversion and comparison. http://stackoverflow.com/a/43892359/1252158 – Summved Jain May 10 '17 at 12:23

1 Answers1

35

Currently you've got period2.DateEnd as a string. I suspect you want:

SELECT date(period2.DateEnd, '+1 day') as date 
FROM Period as period2 
WHERE period2.c_Pk_CodPeriod = '1012'
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194