display the value depending on logical condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report? Or any other suggestion will be appreciated. Thanks
 
skk said:
I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report?

Formatting should be done in the presentation object, i.e.
the report.

Use Conditional Formatting (Format menu) on the report text
box that displays the value. Select the Expresion Is option
and enter:
[Tot Yes] = [Tot Count]
then set the color property to green.

Click the Add button, then use the expression:
[Tot Yes] > [Tot No] And [Tot NO] > 0
and select Yellow in the apporpriate property.

Click Add again the get the third formatting option. Use
the expression:
[Tot No] > [Tot Yes] And [Tot NO] > 0
for Red.
 
Thanks a lot for your reply Marshall. It works!

Marshall Barton said:
skk said:
I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report?

Formatting should be done in the presentation object, i.e.
the report.

Use Conditional Formatting (Format menu) on the report text
box that displays the value. Select the Expresion Is option
and enter:
[Tot Yes] = [Tot Count]
then set the color property to green.

Click the Add button, then use the expression:
[Tot Yes] > [Tot No] And [Tot NO] > 0
and select Yellow in the apporpriate property.

Click Add again the get the third formatting option. Use
the expression:
[Tot No] > [Tot Yes] And [Tot NO] > 0
for Red.
 
Back
Top