Created
October 6, 2011 14:11
-
-
Save dbolser/1267486 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CASE | |
# | |
WHEN RECEIVED RLIKE '^[0-9]{4}$' | |
THEN STR_TO_DATE(RECEIVED, '%Y') | |
# | |
WHEN RECEIVED RLIKE '^30-JUN-[0-9]{2}$' | |
THEN STR_TO_DATE(RIGHT(RECEIVED, 2), '%y') | |
# | |
WHEN STR_TO_DATE(RECEIVED, '%M %Y') | |
THEN STR_TO_DATE(RECEIVED, '%M %Y') | |
# | |
WHEN STR_TO_DATE(RECEIVED, '%d-%b-%y') | |
THEN STR_TO_DATE(RECEIVED, '%d-%b-%y') | |
# | |
-- American style, gives 4 errors | |
-- European style, gives 6 errors | |
WHEN STR_TO_DATE(RECEIVED, '%d-%m-%Y') | |
THEN STR_TO_DATE(RECEIVED, '%d-%m-%Y') | |
# | |
-- American style, gives ~300 errors | |
WHEN STR_TO_DATE(RECEIVED, '%d/%m/%y') | |
THEN STR_TO_DATE(RECEIVED, '%d/%m/%y') | |
END AS 'Cell line[received date]'#, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment