How do I convert a TIMESTAMP to a BIGINT in Azure Synapse
2
votes
1
answer
1541
views
What's the best way to convert a TIMESTAMP to a BIGINT In Azure Synapse. I tried this (which works) but seems clumsy. Is there a better, more concise and efficient way of doing the same thing?
SELECT CURRENT_TIMESTAMP AS CURR_TS,
CONVERT(BIGINT,
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 112) +
REPLACE(CONVERT(CHAR(12), CURRENT_TIMESTAMP, 114), ':', '')) AS CURR_TS_NUM
Asked by Lauren_G
(69 rep)
Mar 9, 2021, 09:34 PM
Last activity: Mar 10, 2021, 12:05 AM
Last activity: Mar 10, 2021, 12:05 AM