K
Kay
Hi
Im creating a query for my chart to lookup a count of records from 3
different tables using the Driver ID field. I have got the following
code but it comes up with the following error 'You tried to execute a
query that does not include the specified expression 'Driver ID' as
part of an aggregate funtion'. My code is a follows:
SELECT Count(*) AS Expr1
FROM (SELECT Count(*) AS Expr1, [Driver ID]
FROM [Current Jobs]
UNION ALL
SELECT COUNT(*) AS Expr1, [Driver ID]
FROM [Bookings]
UNION ALL
SELECT COUNT(*) AS Expr1, [Driver ID]
FROM [Contract Jobs]) AS query1
WHERE ((([Date]) Between [From Date] And [To Date]))
GROUP BY [Driver ID]
ORDER BY [Driver ID];
Any help will be much appreciated
Im creating a query for my chart to lookup a count of records from 3
different tables using the Driver ID field. I have got the following
code but it comes up with the following error 'You tried to execute a
query that does not include the specified expression 'Driver ID' as
part of an aggregate funtion'. My code is a follows:
SELECT Count(*) AS Expr1
FROM (SELECT Count(*) AS Expr1, [Driver ID]
FROM [Current Jobs]
UNION ALL
SELECT COUNT(*) AS Expr1, [Driver ID]
FROM [Bookings]
UNION ALL
SELECT COUNT(*) AS Expr1, [Driver ID]
FROM [Contract Jobs]) AS query1
WHERE ((([Date]) Between [From Date] And [To Date]))
GROUP BY [Driver ID]
ORDER BY [Driver ID];
Any help will be much appreciated