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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -