I have a query that is returning duplicate records. I created 2 helper queries (EPPR_A) for approved date and (EPPR_R) for received date. The iif statement below is bucketing based on time it took for received to approved. There can be the same loan number with two or 3 different received and approved dates and that is where i am having the issue. basically the scenario below is where i am getting the duplicates:
Scenario
Loan Received Date Approved Date
12345 4/4/2013 4/4/2013
12345 4/12/2013 4/13/2013
12345 4/4/2013 4/13/2013 (DUPLICATE RECORD that is non existant in any of the fields. It seems as though it is taking the received and approved dates from above and combining them. How can I get rid of this and stop this from occuring.) Thanks
ReceivedtoApproved: IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]<=1,"0-24 hours",IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]>1and [EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]<=2,"24-48 hours",IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]>=3 and [EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]<=4,"48-72 hours",IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]>4 and [EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]<=5,"72-96 hours",IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]>5 and [EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]<=6,"96-120 hours",IIf([EPPR_A]![ACTUAL_COMPLETION_DATE]-[EPPR_R]![ACTUAL_COMPLETION_DATE]>6,"120+ hours"))))))