I have the following simple query that I execute on a SQLite3 database:
SELECT AField,AnotherField FROM ATable WHERE AnIntField>strftime('%s');
This works fine and returns the expected result.
If I perform the slightly modified query:
SELECT AField,AnotherField FROM ATable WHERE AnIntField+86400>strftime('%s');
Then I don’t get any results! This doesn’t make any sense! I have tried putting brackets around AnIntField+86400 but that doesn’t help. And yes, the values of AnIntField are sufficiently larger than strftime('%s') that it won’t return different results.
Is there any reason for this behaviour?
This is a total guess but what happens if you wrap AnIntField+86400 in the SQLite3 equivalent of a cast ?
In TSQL you’d do something like this:
My thought is that the AnIntField+val is coming out as an append rather than addition.
Actually, if cast doesn’t work, try changing select to
And see what it spits out.