Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPW 2.6 / Ordinal numbers
Message
From
15/07/1997 14:40:39
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00039855
Message ID:
00040078
Views:
28
> Roughly, it would be something like this: > Define a variable lnDay in your report, or in the calling program, where > lnday = IIF(BETWEEN(DAY(DATE()), 10, 20) .OR. MOD(DAY(DATE()), 10) = 0, 9, > MOD(DAY(DATE()), 10)) > The expression to display the ordinal day number would be : > ALLTRIM(STR(DAY(DATE()))) + iif(lnDay < 2, 'st', iif(lnDay < 3, 'nd', > iif(lnDay < 4, 'rd', "th"))) > > >Anyone know how to put ordinal numbers in a report. I need to print the > day > >of the date as > > > >1st > >2nd > >3rd > >4th..... etc. How about a call to the following UDF: proceudre Day_th parameter ldDate m.lnDay = day(m.lnDate) m.lcReturn = "th" do case case m.lnDay = 1 or m.lnDay = 21 or m.lnDay = 31 m.lcReturn = "st" case m.lnDay = 2 or m.lnDay = 22 m.lcReturn = "nd" case m.lnDay = 3 or m.lnDay = 23 m.lcReturn = "rd" endcase return m.lcReturn
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform