Return records field Timestamp ()

0

I have a table named interessados , I have int_data this field is timestamp() , I have 5 records with the following dates:

2016-09-01 10:15:00
2016-09-01 10:50:00
2016-09-01 18:35:00
2016-09-01 23:15:00
2016-09-15 10:00:00

How do I select only the day 01/09/2016 ? Being timestamp() and I can not WHERE int_data ?

    
asked by anonymous 09.09.2016 / 21:00

2 answers

1

I do this in firebird:

select * from interessados where cast(int_data as date) = '01/09/2016'

I make a cast in the field and work as a simple date

    
09.09.2016 / 21:33
1

You can do enough to do it as follows

WHERE date(int_data) ='20160901'

or even more "relaxed"

 WHERE int_data like '2016-09-01%'

In the first solution you make mysql process the date and in the second you just filter as c was a String

    
09.09.2016 / 21:02