Compare to other table

Hi Guys
I Have Table 1 and Table 2.
Table 2 holds a monthly target, [HrsWeeklyTarget] and Table 1 SUMS a column for that week [HrsWeeklySum]. I want to compare the [HrsWeeklySum] to [HrsWeeklyTarget] and use formatting to highlite the value in a view.
Could anyone help with the syntax of the expression?

Regards

0 6 341
6 REPLIES 6

Steve
Platinum 4
Platinum 4

How would one match a row in Table 2 to the appropriate row in Table 1?

Assuming that Table2 is a child and Table1 is the parent, you can use
[Related Table2 Targets][HrsWeeklyTarget] > [HrsWeeklySum]

The tables have no relationship or parent child status. Table2 simply holds a value of one record.

Do you have anything link HrsWeeklySum to HrsWeeklyTarget at all? Ideally one table would contain a the key to the other. Otherwise it wonโ€™t be possible to keep the information straight. Unless, these table are only meant to hold 1 row each.

Hmm yes I see, I would have to go back to the design and create a key columnโ€ฆ

Yeah, not sure which table youโ€™d want to be the parent and which one would be the child. But one of them needs to contain the keys to other. That will auto create links that you can use to compare values between the two.

Top Labels in this Space