The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Add a format option to the DateTimeFormat function to display ordinal dates

I would like a new format option within the Designer function DateTimeFormat such that where a date is held in the database

e.g. 2023-01-01

 

DateTimeFormat([date],%o)

 

will return 1st not 1 or 01. 

 

Workarounds exist, but are fiddly given the different options....1st, 2nd, 3rd, 4th.....

2 Comments
Alekh
9 - Comet

Was looking for one but since it doesn't exist, here's my way of getting a date to format '1st January 1900', and by extension, the ordinal for any number:

 

trim(DateTimeFormat([modified_at],'%e')) //Day of Month
+
IIF(Right(ToString(DateTimeDay([modified_at])),2) in ('11','12','13'),'th',Switch(Right(ToString(DateTimeDay([modified_at])),1),'th','1','st','2','nd','3','rd')) //Ordinal: if last 2 digits are 11,12,13 then add th otherwise add st,nd,rd if last digit is 1,2,3 respectively
+
DateTimeFormat([modified_at], ' %B %Y') //Month + Year
nickdreach
9 - Comet

Yeah, I've no problem working out some database logic to do it (thanks for your code, by the way)...but if Alteryx could just provide a format option it would be so....easy!