2
I need to provide the option to view the data according to an X time determined by the user, for example
I want the data from 01/03/2011 until 25/12/2014
How can I do this with Mysql? How do I need to mount the table so everything can go well?
2
I need to provide the option to view the data according to an X time determined by the user, for example
I want the data from 01/03/2011 until 25/12/2014
How can I do this with Mysql? How do I need to mount the table so everything can go well?
2
If you have a 'column' with the type DATE, may use the following:
SELECT * FROM table WHERE coluna > '2011-03-01' AND coluna < '2014-12-25'
If 'column' is in DATETIME may use the following:
SELECT * FROM table WHERE coluna > '2011-03-01 00:00:00' AND coluna < '2014-12-25 00:00:00'
Since it was not specified how your database is, this could help. Logically, can be used the TIMESTAMP or TIME, but, just adapt.
Browser other questions tagged php mysql sql
You are not signed in. Login or sign up in order to post.
I undid the closure and the exclusion, I realized it’s not quite duplicate that other.
– bfavaretto
But it’s still a little wide. Your question is only in relation to the database?
– bfavaretto
Yes, how can I get from date X to date Y (query) and how to mount the table (what type to use etc..)
– Vinícius Lara