how to use now() in a where clause mysql

I had a table which had a timestamp on it, I only wanted to return records that were dated today, regardless of time, however it was date and time stamped so needed to find a way to shorten the now() and my timestamp column

This is what i came up with:

select timestamp from table where left(timestamp,10)=left(now(),10);

Worked a treat

 


👟
Tiny Steps Weight Loss Coach
1:1 Daily WhatsApp Coaching • £30/month
Start Your Transformation Today £30 / month
✅ Personalised Plans
✅ Daily Check-ins
✅ No Burnout Method
✅ Cancel Anytime

Trending right now

Share







SubmitExpress.com