This seems like a simple task, and I’ve seen others ask the same question, but I still can’t return any results from my SQL query. I’ve got a date column that’s set by timestamp default current. So it reads YYYY-MM-DD HH-MM-SS.
My SQL query is as follows:
select `paid` from customer_det where `office` = "Blanding" and `date`= CURDATE();
I return a result set when I get rid of the and date = curdate. So I’m curious how to match the two dates. I just need to pull results that have been inserted today, the actual time is irrelevant.
Thanks.
You can cast the timestamp to just get the
DATE()portion and compare: