Date format from MSSQL to other
-
13-11-2019 - |
Question
In MSSQL I have columns with date (only date, without time). It was saved with this function:
ROUND(CAST(GETDATE() AS REAL), 0, 1) + 36163 **(ex. 77009)**
How I can format this date (month etc.) with PHP, MySQL or even MSSQL.
For example: 77009 = 2011-11-01.
Solution
For Sql Server SELECT CONVERT(DateTime,XXX-36163)
eg. SELECT @val = ROUND(CAST(GETDATE() AS REAL), 0, 1) + 36163 SELECT CONVERT(DateTime,@val-36163)
OTHER TIPS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow