I want to get all data of current date from my database I’m using phpMyAdmin
this is the query which I use but it did not show any data
SELECT * FROM tables WHERE time = CURDATE();
I want to get all data of current date from my database I’m using phpMyAdmin
this is the query which I use but it did not show any data
SELECT * FROM tables WHERE time = CURDATE();
3
Answers
In SQL Server, you can do:
SQL Server is smart enough to use an index when converting a date/time to a date, so this is index-safe.
Your syntax is more reminiscent of MySQL. In that database, the best solution is:
It appears you are using SQL Server, so this should work:
try to convert your time to the date format
More about date converting:
https://tableplus.io/blog/2018/09/ms-sql-server-how-to-get-date-only-from-datetime-value.html
https://www.mssqltips.com/sqlservertip/1145/date-and-time-conversions-using-sql-server/