How can I display and count the values whose dates are yesterday?
I used time() to insert date in the database. Example:
URL: google.com youtube
Last or next date, week, month & year calculation. It might be helpful for anyone.
Current Date:
select curdate();
Yesterday:
select subdate(curdate(), 1)
Tomorrow:
select affffdate(curdate(), 1)
Last 1 week:
select between subdate(curdate(), 7) and subdate(curdate(), 1)
Next 1 week:
between affffdate(curdate(), 7) and affffdate(curdate(), 1)
Last 1 month:
between subdate(curdate(), 30) and subdate(curdate(), 1)
Next 1 month:
between affffdate(curdate(), 30) and affffdate(curdate(), 1)
Current month:
subdate(curdate(),day(curdate())-1) and last_day(curdate());
Last 1 year:
between subdate(curdate(), 365) and subdate(curdate(), 1)
Next 1 year:
between affffdate(curdate(), 365) and affffdate(curdate(), 1)