SQL SELECT DATE
if you want to retrieve a date from database,use this staement. For eg. you want to find a particular date from a database, this statement is the answer.
1)For example: let's see the query to get all the records after '2013-12-12'.
SELECT * FROM
table-name WHERE your date-column >= '2013-12-12'
2) another query to retrieve all the records after '2013-12-12' and before '2013-12-13' date.
SELECT* FROM
table-name where your date-column < '2013-12-13' and your date-column >= '2013-12-12'
3)If you want to compare the dates , use of BETWEEN operator is the answer.
SELECT * FROM
table_name WHERE yourdate BETWEEN ?2012-12-12? and ?2013-12-12?
0 Comment(s)