How to get the previous day records from mysql table? -
i trying fetch previous day records table not finding how exactly. need please..
table: record_data
id creationdate 1 | 2013-05-03 04:03:35 | 2 | 2013-05-03 04:03:35 |
now need records created on 2013-05-03. time can anything. query should have operator.
i using below query , gives me empty set.
select creationdate record_data creationdate date_sub(str_to_date('2012-04-05','%d/%m/%y'),interval 1 day);
fairly simple when done sql, add condition
where creationdate between curdate() - interval 1 day , curdate()
there no need convert creationdate date :). , belive fastest way check (which matter if go on large data sets).
Comments
Post a Comment