In this post Gert Grenander makes a suggestion to format the date field to 'yyyy-mm-dd hh:mm:ss'.
How would I convert from 'YYYYMMDD' to 'dd/mm/yy' in my SQL call using the same method?
In this post Gert Grenander makes a suggestion to format the date field to 'yyyy-mm-dd hh:mm:ss'.
How would I convert from 'YYYYMMDD' to 'dd/mm/yy' in my SQL call using the same method?
You can use
CONVERT
function in SQL for Converting to desired formatMore Here
gives:
You'll need to convert the decimal value (DATE2) to string via DIGITS, then use SUBSTR to extract the pieces you need, then use CONCAT (or
||
) to reassemble them including the delimiter you want. If your 'date' column is character, you can leave out the conversion to character.gives: