Conditional Formatting

jk12

Always getting problems.
Local time
Today, 11:20
Joined
Feb 16, 2006
Messages
91
Hi. I have a problem with my conditional formatting. I have two fields field 1 (hours worked) and field 2 (hours per task). Field 1 shows the hours worked based on the difference between a start and finish time and field 2 shows the hours per tasked based on values assigned to the 10 task fields. I set the formatting of field 1 to show up in red if it did not match the value of field 2, which works fine most of the time. However, for certain values i.e. 5 or 6 field 1 still shows up in red even though field 2 has the same value i.e. both equal 6.

Could someone explain to me why this happens and offer a solution if possible.

Thanks for any help.
 
What are the field types? Floating point could cause you problems unless you do some rounding. Can you live with the Currency data type?
 
both the field are just basic number fields with field size set as single and decimal places set as auto. I don't want to round to whole number such as 10, 11 ,12 if possible as I need to know if someone has worked the extra half hour so need to see it as 10.5 or 11.5.

I am open to any ideas so please throw anything that may sort the problem
 
Single is a floating point data type. Currency is a 4 decimal place special integer type field that does not suffer from the floating point approximation problem. Are you using any division to come up with either of the fields? You may need to use CSng() to avoid an ASCII compare.
 
the expression to get field 1 is

([Finish Time]-[Start Time])*24

and field 2 is just [task 1]+[task 2]+[task 3] etc
 
How about trying Round(([Finish Time]-[Start Time])*24,1)
 

Users who are viewing this thread

Back
Top Bottom