Reputation: 43
My table has several fields and one of then is a DateTime, called date, in format 'YYYY-MM-DD hh:mm:ss' and runs with SQLite3. I would like to display all the costumers that came between 8 and 15. Here is my code so far:
SELECT *
FROM Clients
WHERE TIME(date) > strftime('%H','08') AND TIME(date) < strftime('%H','15');
Right now it does not display anything.
Any suggestions ?
Upvotes: 0
Views: 193
Reputation: 3675
Try this:
SELECT *
FROM Clients
WHERE CAST(strftime('%H' , date) AS INT) > 8 AND
CAST(strftime('%H' , date) AS INT) < 15 ;
Upvotes: 1