Jump to content
Server Maintenance This Week. ×

Conditional Text Color


This topic is 7011 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Try this text calculation:

Let ( [ C = Get ( CurrentDate ) ;

yC = Year ( C ) ;

dayC = DayOfYear ( C ) ;

B = BirthDay ;

yB = Year ( B ) ;

dayB = DayOfYear ( B ) ;

Num_Years = yC - yB -(dayC < dayB)

] ;

Case ( Num_Years < 18 ; TextColor ( Num_Years ; RGB ( 255 ; 0 ; 0 ) ) ; Num_Years ) )

Link to comment
Share on other sites

A problem that I am running into is that the Age is already a calc. When I try to add the Text Color function to it the Result is a "?" Am I going to need two seperate fields or is there a way to combine the two calcs? Help would be appreciated.

Thanks.

Link to comment
Share on other sites

Make sure it's a text field. TextColor doesn't work with non-text fields. You may want to use two fields specifically for this reason.

Also, Ralph's calc looks a little off. You want to compare the day of year for the birthday based on the current year. So dayB should be equal to DayOfYear(Date( Month(:; Day(:; yC )) IMO.

Link to comment
Share on other sites

This topic is 7011 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.