Hi I am trying to get the following sql to work in mysql but it always return an empty result set – however there are definitely entries that match the criteria.
I’m new to mySQl so would appreciate if someone could point out where I am going wrong.
SELECT * FROM `ch_results`
WHERE 'readingDateTime' = '2011-03-29 20:00:00'
Remove the quotes around the field name:
Your current query compares string
'readingDateTime'to another string,'2011-03-29 20:00:00', which comparison of course never holds true.