+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

Return Date 1st 2nd 3rd etc


(Mike Alberts) #1

Is there a way to return Date information using ordinal numbers?

For example, October 2, 2017 could be written out as “This 2nd day of October 2017”


(combit Support - Patrick Preuschoff) #2

Hi Mike,

thank you for your post.

You could define an own formula for this purpose which could look like this:

If(Day(@CustomDate) = 1, "The 1st day of " + Month$(@CustomDate), If(Day(@CustomDate) = 2, "The 2nd day of " + Month$(@CustomDate)))

@CustomDate represents a user variable with the content "Date(“02.10.2017”)

This formula leads to the following result:

“The 2nd day of October”

Of course, you can extend this formula accordingly so that it can be used for your requirements. An even slicker way would be to write your own designer function which would enable you to provide the required functionality directly from within your code. See the designer extension samples for various languages for a primer.

Best regards,

Patrick Preuschoff
Technical Support
combit GmbH


(Mike Alberts) #3

THANK YOU!!!

I might still be doing this the long way, but here’s the code I’m using. I only need to return the 1st, 2nd, 3rd part since I have the other stuff written out before & after that variable. For anyone else that finds this, here’s enough for the entire month, and you’d just need to change your date variable.

If(Day(date(Global.Letter_Date)) = 1, “1st”, If(Day(date(Global.Letter_Date)) = 2, “2nd”, If(Day(date(Global.Letter_Date)) = 3, “3rd”, If(Day(date(Global.Letter_Date)) = 4, “4th”, If(Day(date(Global.Letter_Date)) = 5, “5th”, If(Day(date(Global.Letter_Date)) = 6, “6th”, If(Day(date(Global.Letter_Date)) = 7, “7th”, If(Day(date(Global.Letter_Date)) = 8, “8th”, If(Day(date(Global.Letter_Date)) = 9, “9th”, If(Day(date(Global.Letter_Date)) = 10, “10th”, If(Day(date(Global.Letter_Date)) = 11, “11th”, If(Day(date(Global.Letter_Date)) = 12, “12th”, If(Day(date(Global.Letter_Date)) = 13, “13th”, If(Day(date(Global.Letter_Date)) = 14, “14th”, If(Day(date(Global.Letter_Date)) = 15, “15th”, If(Day(date(Global.Letter_Date)) = 16, “16th”, If(Day(date(Global.Letter_Date)) = 17, “17th”, If(Day(date(Global.Letter_Date)) = 18, “18th”, If(Day(date(Global.Letter_Date)) = 19, “19th”, If(Day(date(Global.Letter_Date)) = 20, “20th”, If(Day(date(Global.Letter_Date)) = 21, “21st”, If(Day(date(Global.Letter_Date)) = 22, “22nd”, If(Day(date(Global.Letter_Date)) = 23, “23rd”, If(Day(date(Global.Letter_Date)) = 24, “24th”, If(Day(date(Global.Letter_Date)) = 25, “25th”, If(Day(date(Global.Letter_Date)) = 26, “26th”, If(Day(date(Global.Letter_Date)) = 27, “27th”, If(Day(date(Global.Letter_Date)) = 28, “28th”, If(Day(date(Global.Letter_Date)) = 29, “29th”, If(Day(date(Global.Letter_Date)) = 30, “30th”, If(Day(date(Global.Letter_Date)) = 31, “31st”)))))))))))))))))))))))))))))))