Multiple Queries In 1 Table Transformer Instead Of Nesting

Catrina Chanthasene
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 20, 2024

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

1 answer

2 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2024

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events