H
Hugh self taught
I was given this sql code but have the following error which I can't resolve..
"The SELECT Statement contains a reserved word or
an argument name that misspelled or missing, or the punctuation is incorrect"
SELECT Left([Register],2) AS Reg_2, IIF([Male] = -1, "Males", "Females") AS
Gender, Count([Male]) AS Quanity
FROM Competitors
GROUP BY Left([Register],2), IIF([Male] = -1, "Males", "Females")
UNION ALL SELECT "Total", IIF([Male] = -1, "Males", "Females") AS Gender,
Count([Male]) AS Quanity
GROUP BY "Total", IIF([Male] = -1, "Males", "Females");
I isolated it to the UNION ALL SELECT statements as the sql runs fine if I
remove the code from that select statement on. It must be something over my
head because the code is identical to that of the first SELECT statement
except for the "Total", parameter. Can anyone suggest what's wrong?
"The SELECT Statement contains a reserved word or
an argument name that misspelled or missing, or the punctuation is incorrect"
SELECT Left([Register],2) AS Reg_2, IIF([Male] = -1, "Males", "Females") AS
Gender, Count([Male]) AS Quanity
FROM Competitors
GROUP BY Left([Register],2), IIF([Male] = -1, "Males", "Females")
UNION ALL SELECT "Total", IIF([Male] = -1, "Males", "Females") AS Gender,
Count([Male]) AS Quanity
GROUP BY "Total", IIF([Male] = -1, "Males", "Females");
I isolated it to the UNION ALL SELECT statements as the sql runs fine if I
remove the code from that select statement on. It must be something over my
head because the code is identical to that of the first SELECT statement
except for the "Total", parameter. Can anyone suggest what's wrong?