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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -