November 14, 200718 yr Hello again have a date field that is an auto enter creation date. I need to format just the day name to a different color. [color:red]Mondays [color:green]Tuesday etc The field is formatted as Monday, 1 January 2007 I can't seem to get it to work Help!!!!
November 14, 200718 yr If this is for version 8.5, you will need to use a calculation field with a Text result for this.
November 14, 200718 yr Author Thanks for the response I kinda figured that but can't quite figure out how to do the calc. Should the date field be a text field or a calc field. And if it is set to auto enter, how do i turn it into a text field? Remember, I am still new to all this. Have tried to set it as a calc field results as text and cannot change it to display the way i wanted in the above post. Wednesday, 14 November 2007 displays as 14/11/2007. Edited November 14, 200718 yr by Guest
November 14, 200718 yr Your date field should remain as a date. Create a new calculation field with Result Is Text as shown below: Case( DayOfWeek(MyDateField) = 2; TextColor ( "Monday" ; RGB ( 255 ; 0 ; 0 ) ); DayOfWeek(MyDateField) = 3; TextColor ( "Tuesday" ; RGB ( 0 ; 255 ; 0 ) ); DayOfWeek(MyDateField) = 4; TextColor ( "Wednesday" ; RGB ( 0 ; 0 ; 255 ) ) )
November 14, 200718 yr You should probably leave the CreationDate field as it is (if it's not a date, you won't be able to use it for finding or sorting), and add a new field defined as a calculation (result is Text) = TextColor ( DayName ( CreationDate ) ; Choose ( Mod ( CreationDate ; 7 ) ; RGB ( 0 ; 200 ; 0 ) ; RGB ( 200 ; 0 ; 0 ) ; RGB ( 0 ; 0 ; 200 ) ; RGB ( 200 ; 200 ; 0 ) ; RGB ( 0 ; 200 ; 200 ) ; RGB ( 200 ; 0 ; 200 ) ; RGB ( 200 ; 200 ; 200 ) ) ) & ", " & Day ( CreationDate ) & " " & MonthName ( CreationDate ) & " " & Year ( CreationDate ) Then use this field for displaying the date.
November 15, 200718 yr Author Again Thanks Comment, That works Beautifully, I had come to a similar solution the difference was that I got the day name in a text field and applied the formating to it. A little clumsy but it worked. This is a much more elegant solution. It was also good to learn about the chose and mod functions. Thanks again Edited November 15, 200718 yr by Guest
Create an account or sign in to comment