Created
July 5, 2013 11:08
-
-
Save umidjons/5933834 to your computer and use it in GitHub Desktop.
Convert (Excel date) 5 digit numbers to date in mysql
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
SELECT | |
iar_d AS date_5_num, /* numbers like: 40479, 40298, 39038, 41075 */ | |
DATE('1899-12-30') + INTERVAL iar_d DAY AS normal_date /* converted dates */ | |
FROM registry_private_clinics | |
WHERE iar_d REGEXP '^[0-9]{5}$' /* only rows with NNNNN format, where N is [0-9] */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wonderful!