How to pass the current date to a query in mysql like such query:
select from Dailytimesheet dailytimesheet where dailytimesheet.TrackingDate="2010-05-03"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In MySQL, you can use
CURRENT_DATEto get the current date.Using
NOW()works as well, but gets you the current date and time as a timestamp value. You can truncate it likeDATE(NOW()), butCURRENT_DATEavoids the function call.