Skip to content

Instantly share code, notes, and snippets.

@kauhat
Created June 3, 2015 11:51
Show Gist options
  • Save kauhat/f42e0a25d0ea39996d6a to your computer and use it in GitHub Desktop.
Save kauhat/f42e0a25d0ea39996d6a to your computer and use it in GitHub Desktop.
MySQL - Date compare with formatting
SELECT *, STR_TO_DATE(application.completed, '%m-%d-%y') AS `dateCompleted`
FROM `web244-newassess`.application
WHERE
completed
HAVING
(dateCompleted BETWEEN '2013-04-01' AND '2015-04-01')
ORDER BY dateCompleted;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment