Genx Posted September 20, 2005 Posted September 20, 2005 Right, ive got a small problem, i need to be able to format a date in a certain field like this Saturday 22[color:blue]nd October. Is there anyway to get that second part (the nd) to automatically change according to what the date is... i.e. 21[color:blue]st or 23[color:blue]rd. Cheers for help, genx
aaa Posted September 20, 2005 Posted September 20, 2005 Hy aflgenx! Look attachment. You must to continue calculation formula for all choices. Date.zip
Genx Posted September 20, 2005 Author Posted September 20, 2005 ... Seems a bit tedious but i really need it, so thanks...
LaRetta Posted September 20, 2005 Posted September 20, 2005 (edited) For the life of me, I can't understand why you are creating those extra fields, aaa. Day and DayName are already functions. Hi aflgenx, This calculation (result of text) will do it all. Just copy/paste it into your calc box then change date to your real field name: Case( not IsEmpty( date ); DayName( date ) & " " & Day (date) & Case( PatternCount( " 1 21 31 "; " " & Day( date ) & " " ); "st"; PatternCount( " 2 22 "; " " & Day( date ) & " "); "nd"; PatternCount( " 3 23 "; " " & Day( date ) & " " ); "rd"; "th" ) & " " & MonthName( date ) ) The principle behind this pretty thing was gleaned from -Queue- LaRetta Edited September 20, 2005 by Guest Calc correction
Raybaudi Posted September 20, 2005 Posted September 20, 2005 (edited) cleared because duble Edited September 20, 2005 by Guest duble
Raybaudi Posted September 20, 2005 Posted September 20, 2005 Hi LaRetta it is fine... but with a little typo: Case(not IsEmpty(date); DayName(date) & " " & Day (date)& Case( PatternCount( " 1 21 31 "; " " & Day(date) & " " ); "st"; PatternCount( " 2 22 "; " " & Day(date) & " "); "nd"; PatternCount( " 3 23 "; " " & Day(date) & " " ); "rd"; "th" ) & " " & MonthName(date))
aaa Posted September 20, 2005 Posted September 20, 2005 For the life of me, I can't understand why you are creating those extra fields, aaa. Hi, Laretta! I created this fields only for easy understanding. You are right, this fields is not necessary.
LaRetta Posted September 20, 2005 Posted September 20, 2005 Thanks for the catch, Daniele! I will edit my calc also. That's what happens when I wake up at 2:30 AM and think I can work. :tongue2:
LaRetta Posted September 20, 2005 Posted September 20, 2005 I created this fields only for easy understanding. You are right, this fields is not necessary. Hmmm, my concern is that others (particularly those new) may not realize those fields are unnecessary and will duplicate your example exactly to reproduce your suggestion. So instead of adding to their understanding, it adds to convolution instead because they will perpetuate 'fluff' fields unnecessarily. And each of these unnecessary calculations (used to then combine with the final calculation) will slow a system down substantially. The other issue that is important here is to be sure and type the darned calculations right the first time (my example above). LaRetta
Recommended Posts
This topic is 7003 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now