G
Guest
Hi! I am trying to get this quiry to work right. What I want is to add the
two queries together. So in the query I am having problems with I select the
two queries (no table) to add them together. I match Ret_Civ_Ser If there is
no matching values then I want it to not add the two queries together but to
just bring over that one value.
Query work fine
qryRetCivSerAP2
Ret_Civ_Ser CountOfLAST_NAME
N 79
Y 4
And Query works fine
qryRetCivSerCC2
Ret_Civ_Ser CountOfLAST_NAME
N 38
Note: There is no Y answer for Query==>qryRetCivSerCC2
So I have to check for it in the next query that addes them together
qryRetCivSerAP2CC2
SELECT DISTINCTROW qryRetCivSerAP2.Ret_Civ_Ser,
IIf(([qryRetCivSerAP2.Ret_Civ_Ser]=[qryRetCivSerCC2.Ret_Civ_Ser]),Sum([qryRetCivSerAP2.CountOfLast_Name]+[qryRetCivSerCC2.CountOfLast_Name]),IIf(IsNull([qryRetCivSerAP2.Ret_Civ_Ser]),([qryRetCivSerCC2.Ret_Civ_Ser]=[qryRetCivSerAP2.Ret_Civ_Ser])
And
([qryRetCivSerCC2.CountOfLAST_NAME]=[Expr1]),IIf(IsNull([qryRetCivSerCC2.Ret_Civ_Ser]),([qryRetCivSerAP2.Ret_Civ_Ser]=[qryRetCivSerCC2.Ret_Civ_Ser])
And ([qryRetCivSerAP2.CountOfLast_Name]=[Expr1])))) AS Expr1
FROM qryRetCivSerAP2, qryRetCivSerCC2
GROUP BY qryRetCivSerAP2.Ret_Civ_Ser;
I get a Circular Error 3103 when I try this because I am trying to take the
value and add it back to the Expr1 value
Maybe I am putting to much into this query? I don't know
Please help and Thank You very much!!!
two queries together. So in the query I am having problems with I select the
two queries (no table) to add them together. I match Ret_Civ_Ser If there is
no matching values then I want it to not add the two queries together but to
just bring over that one value.
Query work fine
qryRetCivSerAP2
Ret_Civ_Ser CountOfLAST_NAME
N 79
Y 4
And Query works fine
qryRetCivSerCC2
Ret_Civ_Ser CountOfLAST_NAME
N 38
Note: There is no Y answer for Query==>qryRetCivSerCC2
So I have to check for it in the next query that addes them together
qryRetCivSerAP2CC2
SELECT DISTINCTROW qryRetCivSerAP2.Ret_Civ_Ser,
IIf(([qryRetCivSerAP2.Ret_Civ_Ser]=[qryRetCivSerCC2.Ret_Civ_Ser]),Sum([qryRetCivSerAP2.CountOfLast_Name]+[qryRetCivSerCC2.CountOfLast_Name]),IIf(IsNull([qryRetCivSerAP2.Ret_Civ_Ser]),([qryRetCivSerCC2.Ret_Civ_Ser]=[qryRetCivSerAP2.Ret_Civ_Ser])
And
([qryRetCivSerCC2.CountOfLAST_NAME]=[Expr1]),IIf(IsNull([qryRetCivSerCC2.Ret_Civ_Ser]),([qryRetCivSerAP2.Ret_Civ_Ser]=[qryRetCivSerCC2.Ret_Civ_Ser])
And ([qryRetCivSerAP2.CountOfLast_Name]=[Expr1])))) AS Expr1
FROM qryRetCivSerAP2, qryRetCivSerCC2
GROUP BY qryRetCivSerAP2.Ret_Civ_Ser;
I get a Circular Error 3103 when I try this because I am trying to take the
value and add it back to the Expr1 value
Maybe I am putting to much into this query? I don't know
Please help and Thank You very much!!!