Les Isaacs
Registered User.
- Local time
- Today, 18:02
- Joined
- May 6, 2008
- Messages
- 186
Hi All
This works fine, and take about 1 second to run:
SELECT [qry x all staff].staff_name, DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)""") AS [NoSD55(T)sSubmitted]
FROM [qry x all staff];
... but, as soon as I add a criteria to the DCount expression, the query won't run
(or not in less than 2-3 minutes anyway). The query with the crieria is:
SELECT [qry x all staff].staff_name, DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)""") AS [NoSD55(T)sSubmitted]
FROM [qry x all staff]
WHERE (((DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)"""))>0));
If anyone has any ideas I'd be EXTREMELY grateful
Thanks in advance
Les
This works fine, and take about 1 second to run:
SELECT [qry x all staff].staff_name, DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)""") AS [NoSD55(T)sSubmitted]
FROM [qry x all staff];
... but, as soon as I add a criteria to the DCount expression, the query won't run
SELECT [qry x all staff].staff_name, DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)""") AS [NoSD55(T)sSubmitted]
FROM [qry x all staff]
WHERE (((DCount("[employee_submissions]![submission_serial]","[employee_submissions]","[employee_submissions]![employee] = """ & [staff_name] & """ and [employee_submissions]![submission_type] = ""NHSP SD55(T)"""))>0));
If anyone has any ideas I'd be EXTREMELY grateful
Thanks in advance
Les