H
Hugh self taught
Hi Informed people,
I have been reading the forums but can't find a solution to make my problem
work.
I have a query with the following code
SELECT Left([Nat_Reg],2) AS Prov, IIF([Male] = -1, "Males", "Females") AS
Gender, Count([Male]) AS Quanity
FROM Competitors
GROUP BY Left([Nat_Reg],2), IIF([Male] = -1, "Males", "Females")
UNION ALL SELECT "ZZ", IIF([Male] = -1, "Males", "Females") AS Gender,
Count([Male]) AS Quanity
FROM Competitors
GROUP BY "ZZ", IIF([Male] = -1, "Males", "Females");
I use this as my report source code (May be a problem shortly as I need
other data as well)
I then need to look up a text box value for "Prov" in tbl "Provinces" where
the field is "Province"
The last code I tried is
=DLookUp("[Province]","[Provinces]","[Province_Cde] =" &
[Reports]![rptStatistics]![Prov]) but just get the horrid #error output.
What I need in addition since the last part of the union query is a total,
is something along the lines of IIF the value is not found then "Total"
Any suggestions on how to achieve this. My thinning hair won't last much
longer
I have been reading the forums but can't find a solution to make my problem
work.
I have a query with the following code
SELECT Left([Nat_Reg],2) AS Prov, IIF([Male] = -1, "Males", "Females") AS
Gender, Count([Male]) AS Quanity
FROM Competitors
GROUP BY Left([Nat_Reg],2), IIF([Male] = -1, "Males", "Females")
UNION ALL SELECT "ZZ", IIF([Male] = -1, "Males", "Females") AS Gender,
Count([Male]) AS Quanity
FROM Competitors
GROUP BY "ZZ", IIF([Male] = -1, "Males", "Females");
I use this as my report source code (May be a problem shortly as I need
other data as well)
I then need to look up a text box value for "Prov" in tbl "Provinces" where
the field is "Province"
The last code I tried is
=DLookUp("[Province]","[Provinces]","[Province_Cde] =" &
[Reports]![rptStatistics]![Prov]) but just get the horrid #error output.
What I need in addition since the last part of the union query is a total,
is something along the lines of IIF the value is not found then "Total"
Any suggestions on how to achieve this. My thinning hair won't last much
longer