The commonly used DateDiff function in MSSQL returns the number of days difference between two days. In SQLite, there is a function julianday, which can be replaced.
The usage is: julianday (datetime ()-julianday (CreateTime) -- CreateTime is the column name.
It has always been used in this way. It is a bit necessary today. The same click is valid for one day. It is written as: where julianday (datetime ()-julianday (CreateTime) = 0.
After debugging, I found several errors.
1: The difference between julianday (datetime ()-julianday (CreateTime) is not an integer, it is a floating point, so it is not equal to 0.
Datediff (d, getdate (), '2017-10-13 11:11:11 ') is an integer, which is a difference.
2: datetime (). The default value is UTC time, which is the time difference between it and our default time. Just change it to datetime ('Now ', 'localtime.
Therefore, the correct syntax is: where julianday (datetime ('Now ', 'localtime')-julianday (CreateTime) <1
OK. This is a small record here.