Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding the correct notation after a date

Status
Not open for further replies.

Steve95

MIS
Joined
Nov 3, 2004
Messages
265
Location
US
Hi All

does any one know is their some kind of function in CRXi that adds a correct date notation ie. if its the first of the month it appears as 1st, 3rd or 24th and so forth.

Many Thanks
 
Try:

if remainder(day({table.date}),10) = 1 and
day({table.date}) <> 11 then
totext({table.date},"d")+"st" else

if remainder(day({table.date}),10) = 2 and
day({table.date}) <> 12 then
totext({table.date},"d")+"nd" else

if remainder(day({table.date}),10) = 3 and
day({table.date}) <> 13 then
totext({table.date},"d")+"rd" else

totext({table.date},"d")+"th"

-LB
 
Thanks lbass for the above, but I forgot to mention that Iam working from a sql view and the field representing the date, returns the date as a singular number field eg. 28,27,1,3,4 etc etc

Any ideas, how i can add the notations?

Many Thanks

 
Change it to:

if remainder({table.no},10) = 1 and
{table.no} <> 11 then
totext({table.no},0,"")+"st" else

if remainder({table.no},10) = 2 and
{table.no} <> 12 then
totext({table.no},0,"")+"nd" else

if remainder({table.no},10) = 3 and
{table.no} <> 13 then
totext({table.no},0,"")+"rd" else

totext({table.no},0,"")+"th"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top