Are you sure nameID is correct?
It is
Do a showmessage(nameID).
It works
Try to make nameID an integer and use asInteger instead of asstring for the param.
It's used throughout my application (3020 lines) as a
String. It works in all other queries, too.
Show the exact sql via
Showmessage(SQL.Text)
With all this ' there could be some problems.
This is what I get from Showmessage(SQL.Text).
SELECT (strftime('%s', 'now', 'localtime') - strftime('%s', 'skip_date')) / 3600 AS elapsed FROM MC_Skipped WHERE nid = :nid
(I'm guessing the SQL is sightly different from what you execute in a db manager)[/quote]
In DB Browser, I use the same:
'SELECT (strftime("%s", "now", "localtime") - strftime("%s", "skip_date")) / 3600 FROM MC_Skipped WHERE nid = 103;'
Do a showmessage(ZQ1.Recordcount.tostring) after the open to see if there are any records returned.
[/quote]
I get '1', as it should be.
I use many queries in this app. All of them work as expected. But this is the first time I've ever worked with DateTime.
I pulled out the query and replaced it with:
SELECT skip_date FROM MC_Skipped/code]
and it worked. But I still can't make the time query work.