dimanche 14 juin 2015

sqlite Select specific day of specific month and none specific month

What I am trying to do is to select a specific month and a specific day from a timestamp. What I have tried is this:

SELECT t FROM test WHERE t BETWEEN '2015-08-01 00:00:00' AND '2015-08-01 23:59:59';

with 8 being the specifc month and 1 being the specific day but this doesn't return anything.

Another thing I would like to do is to choose a specific day of every month of the year what I have tried that I know is wrong but I am not sure how else to do it is:

SELECT t FROM test WHERE t BETWEEN '2015-01-12 00:00:00' AND '2015-24-12 23:59:59';

I can see why this wouldn't work as I take every timestamp from the day in the first month to the same day in the last month, but how can I do it?

Aucun commentaire:

Enregistrer un commentaire