Les Isaacs
Registered User.
- Local time
- Today, 16:16
- Joined
- May 6, 2008
- Messages
- 186
Hi All
I have only recently started to tackle subqueries, and am now stuck on this syntax:
InThisPayrun: Exists (SELECT staffs.practice, stafpay.[month name], stafpay.staff_name
FROM staffs INNER JOIN stafpay ON staffs.staff_name = stafpay.staff_name
WHERE (((staffs.practice)= [Forms]![frm x main]![prac name]) AND ((stafpay.[month name])= [Forms]![frm x main]![month name] )))
When I try to run the main query I just get a syntax error message on this field.
I obtained the sql for the Select statement by creating the query in design view, testing that the query ran OK, then switching to sql view and copying the code, then adding
InThisPayrun: Exists ()
to my main query, then pasting the Select statement into the brackets.
I used the same syntax with the Exists operator in another subquery and all was well, and I can't see the difference in the syntax I'm using here.:banghead:
If anyone has any ideas I'd be extremely grateful.
Many thanks
Les
I have only recently started to tackle subqueries, and am now stuck on this syntax:
InThisPayrun: Exists (SELECT staffs.practice, stafpay.[month name], stafpay.staff_name
FROM staffs INNER JOIN stafpay ON staffs.staff_name = stafpay.staff_name
WHERE (((staffs.practice)= [Forms]![frm x main]![prac name]) AND ((stafpay.[month name])= [Forms]![frm x main]![month name] )))
When I try to run the main query I just get a syntax error message on this field.
I obtained the sql for the Select statement by creating the query in design view, testing that the query ran OK, then switching to sql view and copying the code, then adding
InThisPayrun: Exists ()
to my main query, then pasting the Select statement into the brackets.
I used the same syntax with the Exists operator in another subquery and all was well, and I can't see the difference in the syntax I'm using here.:banghead:
If anyone has any ideas I'd be extremely grateful.
Many thanks
Les