IIf and return value

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

Guest

I have an access db that has linked tables that are in my payroll system. In
a query I am trying to track the changes to a table, the problem is that this
table is huge and the programmers put too many fields in it. For every
change made a snapshot is sent to an "AT" table and then the change is made
to the "T" table.

This query concerns federal and state w-4 withholdings. If the value is the
same, I want "0" returned, if the value is not the same, then I want the
value returned. I am wondering if i have made a circular reference. help?

This is the function

BeforeFed: IIf(([dbo_Pr_EmpPayData_AT]![chrFedWithholdStatus] & "-" &
[dbo_Pr_EmpPayData_AT]![intFedExemptions])<>([dbo_Pr_EmpPayData_T]![chrFedWithholdStatus]
& "-" &
[dbo_Pr_EmpPayData_T]![intFedExemptions]),"0",([dbo_Pr_EmpPayData_T]![chrFedWithholdStatus] & "-" & [dbo_Pr_EmpPayData_T]![intFedExemptions]))

So if Fed w/h from table A does not match Fed w/h from table B the show me
the value from table b, if they are the same, then return "0" which I can
then filter out with critera.

Julie
 
Never mind. I need to go back to equation writing 101!!

Here is the correct equation to get the result I am after

BeforeFed: IIf(([dbo_Pr_EmpPayData_AT]![chrFedWithholdStatus] & "-" &
[dbo_Pr_EmpPayData_AT]![intFedExemptions])=([dbo_Pr_EmpPayData_T]![chrFedWithholdStatus]
& "-" &
[dbo_Pr_EmpPayData_T]![intFedExemptions]),"0",([dbo_Pr_EmpPayData_AT]![chrFedWithholdStatus] & "-" & [dbo_Pr_EmpPayData_AT]![intFedExemptions]))
 
Back
Top