I have 1 table with 3 columns titled "Initiation Date", "Due Date', and "Completion Date". I would like for the date format to always display as dd/mm/yy in all 3 columns. I was successful in adding code to the table transformer to format 1 column. How can I format all 3 columns in a single table transformer, vs. having to nest each one? The code I used was:
SELECT T1.'Initiation Date', T1.'Due Date', T1.'Completion Date',
FORMATDATE('Due Date','dd/mm/yy')
AS 'Due Date' FROM T1
Hi @Catrina Chanthasene ,
You may use the following SQL query for your case:
SELECT
FORMATDATE('Initiation Date', "dd/mm/yy") AS 'Initiation Date',
FORMATDATE('Due Date', "dd/mm/yy") AS 'Due Date',
FORMATDATE('Completion Date',"dd/mm/yy") AS 'Completion Date'
FROM T1
Please note that you use ' ' to refer to columns (for example, 'Column_name').
And you use " " (double quotes) to refer to strings. So, the correct version is FORMATDATE('Due Date', "dd/mm/yy") and not FORMATDATE('Due Date', 'dd/mm/yy').
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.