xwishmasterx Posted April 28, 2011 Share Posted April 28, 2011 I am using the below code for todays count and it works fine: ...AND left(vtp_tracking.action_date,10) = CURDATE() I was hoping I could use the below code to select yesterdays count: ....AND left(vtp_tracking.action_date,10) = CURDATE(), INTERVAL 1 DAY) but doesnt seem to work. Is there anything I am missing (there must be)? Quote Link to comment https://forums.phpfreaks.com/topic/234998-curdate-interval-1day-not-working/ Share on other sites More sharing options...
Pikachu2000 Posted April 28, 2011 Share Posted April 28, 2011 ....AND left(vtp_tracking.action_date,10) = DATE_SUB( CURDATE(), INTERVAL 1 DAY) ) Quote Link to comment https://forums.phpfreaks.com/topic/234998-curdate-interval-1day-not-working/#findComment-1207715 Share on other sites More sharing options...
xwishmasterx Posted April 28, 2011 Author Share Posted April 28, 2011 thanks for your reply Pikachu2000 your code didn't work, however It showed me what was wrong The right code is: ....AND left(vtp_tracking.action_date,10) = DATE_SUB( CURDATE(), INTERVAL 1 DAY) thanks Quote Link to comment https://forums.phpfreaks.com/topic/234998-curdate-interval-1day-not-working/#findComment-1207732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.