Confluence default '//' date format not aligned with sql
Asked by MudCo:

Hi Team, I have a table that contains data that I need to segregate into 4 different FY's (FY25Q1 to FY25Q4). The date format used in my column is Confluence's standard '//'. The code I have below gives me results where all the results in the new column (END AS..) is text 'BEYOND FY25'. I am not sure if the code is incorrect or if Confluence is unable to recognise the date format used in my code vs the format in my table.

SELECT \*,

CASE

WHEN T1.'Date Contract will Expire' \>= '01 Oct 2024' AND T1.'Date Contract will Expire' \<= '31 Dec 2024' THEN "FY25Q1"

WHEN T1.'Date Contract will Expire' \>= '01 Jan 2025' AND T1.'Date Contract will Expire' \<= '30 Mar 2025' THEN "FY25Q2"

WHEN T1.'Date Contract will Expire' \>= '01 Apr 2025' AND T1.'Date Contract will Expire' \<= '30 Jun 2025' THEN "FY25Q3"

WHEN T1.'Date Contract will Expire' \>= '01 Jul 2025' AND T1.'Date Contract will Expire' \<= '30 Sep 2025' THEN "FY25Q4"

ELSE "BEYOND FY25"

END AS 'FY25 \& BEYOND Contracts'

FROM T1


Answers:
author: Stiltsoft support
body: Hi [@MudCo](/t5/user/viewprofilepage/user-id/5326753) ,

Please define what 3rd party app you are using cause there is no any SQL in Confluence out-of-the-box.

Is it our [Table Filter, Charts \& Spreadsheets for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-charts-spreadsheets-for-confluence?tab=overview&hosting=datacenter&utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) app and its [Table Transformer](https://docs.stiltsoft.com/tfac/dc-server/table-transformer-42241552.html?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) macro or smth else?

comments: author: MudCo
body: Hi, apologies. I missed to mention this is inside a table transformer I have wrapped my table in.


author: Stiltsoft support
body: Then check that the date format in the Table Transformer macro settings corresponds to the format that is used in your source table.

You've mentioned that you use the standard // datepicker but it is a standard format for you and not for all Confluence instances (it depends, for example, on the language used). Besides, if you used the macro with a different set of settings previously, it may remember them and the date format may differ.

Then check the SQL query: as I see, you refer to your dates as '01 Oct 2024'.

The macro is based on the AlaSQL query, so ' ' and " " differ. The ' ' are used when you call out your column names and " " are used when you refer to strings. So, the "01 Oct 2024" option will be correct.


author: MudCo
body: Hi there, spologies to respond back late.  

I tried with both ' ' and '' '' and the results was, the whole column, irrespective of the dates gave the output BEYOND FY25 for all rows. Also, when you said " " would be more apt, wouldn't that be used for a text string and not the confluence date (//) ?


author: MudCo
body: Adding to it

'01 Oct 2024' AND T1.'Date Contract will Expire' \<= '31 Dec 2024' THEN "FY25Q1"

where my date range is between the given criteria and in tables the date looks like the other screenshot attached. Regarding location, I checked my system and I am attaching![confluence date format.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/347922i8B3393192468FB19/image-size/large?v=v2&px=999 "confluence date format.jpg")![Settings.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/347923iF141B517F8BF5A12/image-size/large?v=v2&px=999 "Settings.jpg") the screenshots for the same.


author: Stiltsoft support
body: As I've said before, ' ' are used when you call out column names. When you refer to strings, you need to use " ":

++"01 Oct 2024"++ AND T1.'Date Contract will Expire' \<= ++"31 Dec 2024"++ THEN ++"FY25Q1"++

And again make sure that you have a proper date format inside the Table Transformer macro settings: the "01 Oct 2024" corresponds to the "dd M yy".


author: MudCo
body: perfect! I checked my settings and it was not in "dd M yy" form. And I changed the ' ' to

" ". Worked perfectly. Thanks so much for your help!


Tags: confluence-data-center

data-center

filter

table

table-filter

table-filter-and-charts

table-filter-charts-spreadsheets

table-transformer