P
PayeDoc
Hello All
I have SELECT statement that I have built using the SQL view of a query. The
SELECT statement contains WHERE, GROUP BY, HAVING and ORDER BY parameters.
All has been working fine, until today when I have needed to add an extra
criteria to the HAVING part:
This worked:
"HAVING ((([x confirmed].name)=" & Chr(34) & [Forms]![staffs subform
new]![employee] & Chr(34) & "))"
but this does not:
"HAVING ((([x confirmed].entered) =" & Chr(34) & [forms]![staffs subform
new]![child813]![entered] & Chr(34) & ") and (([x confirmed].employee)=" &
Chr(34) & [Forms]![staffs subform new]![employee] & Chr(34) & "))"
and nor does this:
"HAVING ((([x confirmed].entered) = [forms]![staffs subform
new]![child813]![entered]) and (([x confirmed].employee)=" & Chr(34) &
[Forms]![staffs subform new]![employee] & Chr(34) & "))"
The [x confirmed].entered field has been added to the SELECT and the GROUP
BY parts.
I keep getting either a "too few parameters" or a "data mismatch" error. In
case it is relevant (but I can't see that it can be!), [entered] is a
date/time field that defaults to 'Now' for each new record, and is never
altered. The query I use to help me with the SQL syntax has no problem with
setting the [entered] parameter as criteria - that's how I got the first
failed effort above!
Hope someone can help.
Many thanks
Leslie Isaacs
I have SELECT statement that I have built using the SQL view of a query. The
SELECT statement contains WHERE, GROUP BY, HAVING and ORDER BY parameters.
All has been working fine, until today when I have needed to add an extra
criteria to the HAVING part:
This worked:
"HAVING ((([x confirmed].name)=" & Chr(34) & [Forms]![staffs subform
new]![employee] & Chr(34) & "))"
but this does not:
"HAVING ((([x confirmed].entered) =" & Chr(34) & [forms]![staffs subform
new]![child813]![entered] & Chr(34) & ") and (([x confirmed].employee)=" &
Chr(34) & [Forms]![staffs subform new]![employee] & Chr(34) & "))"
and nor does this:
"HAVING ((([x confirmed].entered) = [forms]![staffs subform
new]![child813]![entered]) and (([x confirmed].employee)=" & Chr(34) &
[Forms]![staffs subform new]![employee] & Chr(34) & "))"
The [x confirmed].entered field has been added to the SELECT and the GROUP
BY parts.
I keep getting either a "too few parameters" or a "data mismatch" error. In
case it is relevant (but I can't see that it can be!), [entered] is a
date/time field that defaults to 'Now' for each new record, and is never
altered. The query I use to help me with the SQL syntax has no problem with
setting the [entered] parameter as criteria - that's how I got the first
failed effort above!
Hope someone can help.
Many thanks
Leslie Isaacs