SQLite equivalent of SQL Server DateAdd function

前端 未结 2 1874
自闭症患者
自闭症患者 2020-12-17 09:55

I need help reproducing the following SQL statement to a statement that SQLite understands.

SELECT * FROM SomeTable WHERE [Date] >= DATEADD(day, -14, GETD         


        
相关标签:
2条回答
  • 2020-12-17 10:35

    From this link

    Date And Time Functions

    it would seem that you can use something like

    date(timestring, modifier, modifier, ...) 
    
    SELECT date('now','+14 day'); 
    

    Does this seem correct to you?

    0 讨论(0)
  • 2020-12-17 10:42

    The method Adriaan Stander gives result in GMT

    You can do it in LocalTime like this

    select DateTime('Now', 'LocalTime', '+1 Day');
    
    0 讨论(0)
提交回复
热议问题