Vinoth
Vinoth

Reputation: 773

How to retrieve the date records based on today's date in C# and MySQL

I want to select the records where the dateTimefield is equal to today's date. The DBMS is MySQL.

Upvotes: 0

Views: 132

Answers (2)

iJade
iJade

Reputation: 23791

SELECT * FROM tableName WHERE DATE_FORMAT(dateField,'%m-%d-%Y')=DATE_FORMAT(NOW(),'%m-%d-%Y');

Upvotes: 0

eggyal
eggyal

Reputation: 125835

SELECT * FROM my_table WHERE DATE(dateTimefield) = CURRENT_DATE

Upvotes: 1

Related Questions