I created a query that pulls information from 2 other queries and everything was going fine until I saved the query. I now get a circular reference error
Here is the query. Any help would be appreciated
SELECT [CashValue Link Query1].Facility,
[CashValue Link Query1].[Financial Class],
[CashValue Link Query1].Date,
[CashValue Link Query1].Date,
[CashValue Link Query1].[Total A/R],
[CashValue Link Query1].Current,
[CashValue Link Query1].[Over 30 Days],
[CashValue Link Query1].[Over 60 Days],
[CashValue Link Query1].[Over 90 Days],
[CashValue Link Query1].[Over 120 Days],
[CashValue Link Query1].[Actual Reimbursement %]
,iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Total A/R] * [CashValue Link Query1].[Actual Reimbursement %]), [CashValue Link Query1].[A/R Cash Value]) AS [A/R Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Current] * [CashValue Link Query1].[Actual Reimbursement %]),[CashValue Link Query1].[CUR Cash Value]) AS [CUR Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Over 30 Days] * [CashValue Link Query1].[Actual Reimbursement %]), [CashValue Link Query1].[T30 Cash Value]) AS [T30 Value],
IIf([CashValue Link Query1].[Financial Class]='VETERANS ADMIN',([CashValue Link Query1].[Over 60 Days]*[CashValue Link Query1].[Actual Reimbursement %]),[CashValue].[T60 Cash Value]) AS [T60 Value],
IIf([CashValue Link Query1].[Financial Class]='VETERANS ADMIN',([CashValue Link Query1].[Over 90 Days]*[CashValue Link Query1].[Actual Reimbursement %]),[CashValue].[T90 Cash Value]) AS [T90 Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Over 120 Days] * [CashValue Link Query1].[Actual Reimbursement %]) ,[CashValue Link Query1].[T120 Cash Value]) AS [T120 Value],
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Total A/R]-[TCASH Query11].BAL),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[TA/R],[CashValue Link Query1].PAR)) AS P1AR,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Current]-[TCASH Query11].CUR),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Current],[CashValue Link Query1].PCUR)) AS P1CUR,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 30 Days]-[TCASH Query11].O30),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 30],[CashValue Link Query1].P30)) AS PA30,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 60 Days]-[TCASH Query11].O60),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 60],[CashValue Link Query1].P60)) AS PA60,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 90 Days]-[TCASH Query11].O90),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 90],[CashValue Link Query1].P90)) AS PA90,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 120 Days]-[TCASH Query11].O120),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 120],[CashValue Link Query1].P120)) AS PA120,
[CashValue Link Query1].[TA/R],
[CashValue Link Query1].[Total CUR],
[CashValue Link Query1].[Total 30],
[CashValue Link Query1].[Total 60],
[CashValue Link Query1].[Total 90],
[CashValue Link Query1].[Total 120]
FROM [CashValue Link Query1] RIGHT JOIN [TCASH Query11] ON ([CashValue Link Query1].Date=[TCASH Query11].ODATE) AND ([CashValue Link Query1].[Financial Class]=[TCASH Query11].CODE) AND ([CashValue Link Query1].Facility=[TCASH Query11].FCDESC);
Here is the query. Any help would be appreciated
SELECT [CashValue Link Query1].Facility,
[CashValue Link Query1].[Financial Class],
[CashValue Link Query1].Date,
[CashValue Link Query1].Date,
[CashValue Link Query1].[Total A/R],
[CashValue Link Query1].Current,
[CashValue Link Query1].[Over 30 Days],
[CashValue Link Query1].[Over 60 Days],
[CashValue Link Query1].[Over 90 Days],
[CashValue Link Query1].[Over 120 Days],
[CashValue Link Query1].[Actual Reimbursement %]
,iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Total A/R] * [CashValue Link Query1].[Actual Reimbursement %]), [CashValue Link Query1].[A/R Cash Value]) AS [A/R Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Current] * [CashValue Link Query1].[Actual Reimbursement %]),[CashValue Link Query1].[CUR Cash Value]) AS [CUR Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Over 30 Days] * [CashValue Link Query1].[Actual Reimbursement %]), [CashValue Link Query1].[T30 Cash Value]) AS [T30 Value],
IIf([CashValue Link Query1].[Financial Class]='VETERANS ADMIN',([CashValue Link Query1].[Over 60 Days]*[CashValue Link Query1].[Actual Reimbursement %]),[CashValue].[T60 Cash Value]) AS [T60 Value],
IIf([CashValue Link Query1].[Financial Class]='VETERANS ADMIN',([CashValue Link Query1].[Over 90 Days]*[CashValue Link Query1].[Actual Reimbursement %]),[CashValue].[T90 Cash Value]) AS [T90 Value],
iif([CashValue Link Query1].[Financial Class] = 'VETERANS ADMIN',([CashValue Link Query1].[Over 120 Days] * [CashValue Link Query1].[Actual Reimbursement %]) ,[CashValue Link Query1].[T120 Cash Value]) AS [T120 Value],
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Total A/R]-[TCASH Query11].BAL),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[TA/R],[CashValue Link Query1].PAR)) AS P1AR,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Current]-[TCASH Query11].CUR),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Current],[CashValue Link Query1].PCUR)) AS P1CUR,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 30 Days]-[TCASH Query11].O30),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 30],[CashValue Link Query1].P30)) AS PA30,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 60 Days]-[TCASH Query11].O60),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 60],[CashValue Link Query1].P60)) AS PA60,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 90 Days]-[TCASH Query11].O90),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 90],[CashValue Link Query1].P90)) AS PA90,
IIf([CashValue Link Query1].[Financial Class] In ('VETERANS ADMIN'),([CashValue Link Query1].[Over 120 Days]-[TCASH Query11].O120),IIf([CashValue Link Query1].[Financial Class] In ('PRIVATE PAY'),[Total 120],[CashValue Link Query1].P120)) AS PA120,
[CashValue Link Query1].[TA/R],
[CashValue Link Query1].[Total CUR],
[CashValue Link Query1].[Total 30],
[CashValue Link Query1].[Total 60],
[CashValue Link Query1].[Total 90],
[CashValue Link Query1].[Total 120]
FROM [CashValue Link Query1] RIGHT JOIN [TCASH Query11] ON ([CashValue Link Query1].Date=[TCASH Query11].ODATE) AND ([CashValue Link Query1].[Financial Class]=[TCASH Query11].CODE) AND ([CashValue Link Query1].Facility=[TCASH Query11].FCDESC);