I want to look for all records within a table that has date column for a specific date, at the moment I am trying this query,
SELECT *
FROM Table_ABC
WHERE DateCreated CONTAINS 24/10/2012
But its not working
If the DateCreated column is a DATETIME type, you should try:
SELECT *
FROM Table_ABC
WHERE YEAR(DateCreated) = 2012
AND MONTH(DateCreated) = 10
AND DAY(DateCreated) = 24
or simply
SELECT *
FROM Table_ABC
WHERE DATE(DateCreated) = "2012-10-24"
Try:
Select * from Table_ABC where DateCreated between '24/10/2012 HH:MM:SS' and '24/10/2012 HH:MM:SS'
Changes hours minutes and seconds to be what you want it to be and it's usually in 24 hour time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With