Sample Header Ad - 728x90

Want to change a timestamp date to an integer YYYYMMDD

0 votes
1 answer
19586 views
I have this input "2017-07-21 15:31:04.853453" and I want it to return "20170721" as output. How can I do it using cast or convert function? My column input is the current time (CURRENT_TIMESTAMP). From cast(CURRENT_TIMESTAMP as date) I have the output "2017-07-24", then I can do several concatenates with substrings. It should work but I wonder if there isn't any other way to get "integer YYYYMMDD".
Asked by Pedro Pereira (1 rep)
Jul 21, 2017, 02:38 PM
Last activity: Apr 21, 2020, 11:23 AM