I am using the 'Edit Table Transformer' macro.
In SQL I know I can extract the month using SELECT *, MONTH('Due') AS 'Month',
However, it returns an integer value (i.e. '1' for month of January, '2' for February, etc.)
I want the result to actually list the month name (i.e., January, February, March, etc.)
I've been trying other workaround to no avail. i.e., FORMATDATE etc. I've also tried to do a WHEN-THEN-ELSE case that says if "1" then return 'January', but I could get that to work either.
Note: There are other columns of data that need to be left in the format like mm/dd/yy, so I don't want to change the format in the Settings tab and force a particular format across all the dates.
Hi @Laurie Huth,
Please follow these steps: go to the Table Transformer macro settings and set the required date format that corresponds to the format used in your source table.
Then use the following SQL query:
SELECT 'Date', 'Month',
CASE
WHEN 'Month' = 1 THEN "January"
WHEN 'Month' = 2 THEN "February"
WHEN 'Month' = 3 THEN "March"
WHEN 'Month' = 4 THEN "April"
WHEN 'Month' = 5 THEN "May"
WHEN 'Month' = 6 THEN "June"
WHEN 'Month' = 7 THEN "July"
WHEN 'Month' = 8 THEN "August"
WHEN 'Month' = 9 THEN "September"
WHEN 'Month' = 10 THEN "October"
WHEN 'Month' = 11 THEN "November"
WHEN 'Month' = 12 THEN "December"
END
AS 'Pretty Month Name'
FROM (
SELECT *,
MONTH('Date') AS 'Month'
FROM T1)
Hope this helps your case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.