1

I'm already using a query like below to select records on a special date since I'm storing a sort of date on my table:

... WHERE YEAR(date) = YEAR((SELECT MAX(date) FROM tblname)) AND
          MONTH(date) = MONTH((SELECT MAX(date) FROM tblname)) AND
          DAY(date) = DAY((SELECT MAX(date) FROM tblname)) ...

but I'm looking for a more simple way to doing this.

What SQL query should I use instead?

1 Answer 1

1

Try this:

... WHERE DATE(date) = DATE(SELECT MAX(date) FROM tblname)) ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.