Categories
- All Categories
- Oracle Analytics Learning Hub
- 19 Oracle Analytics Sharing Center
- 18 Oracle Analytics Lounge
- 232 Oracle Analytics News
- 44 Oracle Analytics Videos
- 15.9K Oracle Analytics Forums
- 6.2K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 87 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
How to convert date to text with this format 'YYYY-MM-DD"?
Hi,
Anyone can help on how to convert date to text with this format 'YYYY-MM-DD"?
Best Answer
- 
            You can try this formula: cast(year("Snapshot Date") as CHAR(4)) || '-' || cast(month("Snapshot Date")as CHAR(2)) || '-' || cast(day("Snapshot Date")as CHAR(2)) 0
Answers
- 
            Hi, @JoseP-Oracle . Thank you for your response; however, it's giving me single digits for months and days from 1 to 9 even though we have set CHAR(2) I may have a problem with sorting. 0
- 
            @JobDeLuna - Before fixing the expression to your need, just want to confirm why the need to covert the date to text. If for display format at the report, you can configure a desired display format in the visualization -> Properties -> Date / Time Format -> Format for the column. i.e. you can set the format in there as YYYY-MM-DD 1
- 
            I just tweaked that formula a bit and it works this way. Is this how you want to display your dates in text format? cast(year("PC0"."Time"."Date") as CHAR(4)) || '-' || cast(MONTHNAME("PC0"."Time"."Date") as CHAR(3)) || '-' || cast(DAY("PC0"."Time"."Date") as CHAR(2))And this is how it looks for a whole month! 1



