Wednesday, May 11, 2011

An MYSQL Statement that gets the last Thursday in the month

Here is a simplified version using just date math:

SELECT LAST_DAY(NOW()) - ((7 + WEEKDAY(LAST_DAY(NOW())) - 5) % 7);

No comments:

Post a Comment