Skip to main content
Solved

Color Code Date Field based on Formula


Forum|alt.badge.img+2

Hi there,

New to Quickbase, but have a big MS Excel background. What I used to find easy in Excel, I can't seem to get my head around in QB. If anyone can help enlighten my rookie brain, it would be greatly appreciated.

I'm trying to colour-code a date type field based on multiple conditions:

Say for example I have field called 'Survey Required By', which is the date for when we want a survey to be completed, and then another field called 'Survey Completed', and in this field we enter the date when the survey is completed.

I want to highlight the field text or background in red if the 'Survey Required By' date is today or older, and the 'Survey Completed' field is blank.

I've googled and tired many different formulas, but the best I've managed is to color code a whole row on a report, which I don't want to do. I just want the 1 field color changed.

The formula I have so far is:

if(
isnull([Survey Completed]) and [survey required by]=today(),
"red",""
)

 

 

 

 

Best answer by MarkShnierYou

What is the name of your Rich Text field?  Try adding it to the report.  :)

View original
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24

You will need to create a new Formula Rich Text field.  It's not like Excel where you can format the cell  

here are some examples:


"<div style=\"color:black;background-color:red;\"><div>" & [Answer]

 

or for a simple bold red 

"<font color=red><b>" & [my text field] 


MarkShnierYou
Forum|alt.badge.img+24

In order to check whether a text field is blank you need to check it against empty quotes. It is obscure, but it is documented that The is no function. Does not work on text fields.

 

In order to check whether a text field is blank you need to check it against empty quotes. It is obscure, but it is documented that The is no function does not work on text fields.

 

So if [survey completed] as a text, feel like yes no,

 

then use

 

if([Survey completed] = ""

another tip is that if you were checking a freeform data entry text field to be blank. I do this.

 

if (Trim([my field]) = "", ......

Just in case the user has entered some empty spaces in the field

 

 

 


MarkShnierYou
Forum|alt.badge.img+24

What is the name of your Rich Text field?  Try adding it to the report.  :)