ordinals

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Namp
Posts: 8
Joined: Tue Oct 10, 2017 12:44 pm

ordinals

Post by Namp » Sat Sep 19, 2009 8:45 pm

hi there again,____what function in RR converts numerics to ordinals?____thanks,____Namp

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: ordinals

Post by kfleming » Tue Sep 22, 2009 3:44 pm

What output format do you need?__Kathleen__R&R Support

Namp
Posts: 8
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: ordinals

Post by Namp » Sat Sep 26, 2009 11:57 am

____like 1 as 1st, 2 as 2nd, 3 as 3rd and so on.____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: ordinals

Post by kfleming » Mon Sep 28, 2009 10:16 am

Create a user defined function called Ordinal with the declaration:__Ordinal(n_value)____and expression:__ltrim(str(value)+case(right(str(value),2),"11","th","12","th","13","th",case(right(str(value),1),"1","st","2","nd","3","rd","th")))____You can then use the function named Ordinal to convert a numeric value to an ordinal string.____Kathleen__R&R Support

Post Reply