AccessChap
Registered User.
- Local time
- Today, 20:01
- Joined
- Apr 14, 2009
- Messages
- 32
Hi guys,
I've got two queries, one for a Peugeot franchise and one for a Citroen franchise. Apart from the table name they are the same query. But can I merge the two queries into one for a graph of grand totals? Nope! Anyone got any ideas? The two queries are listed below and I basically want to return the sum of these two queries i.e. one row of results to give me a "total" graph to accompany my Peugeot and Citroen graphs...
SELECT Format(Date_Logged,"mm " & "mmm " & "yy") AS [Month],
Count(tbl_Security_Request.Record_ID) AS [Security Requests]
FROM tbl_Security_Request
WHERE (((tbl_Security_Request.Date_Logged)>Now()-365))
GROUP BY Format(Date_Logged,"mm " & "mmm " & "yy"),
Right$([tbl_Security_Request]![Date_Logged],4) &
Mid([tbl_Security_Request]![Date_Logged],4,2)
ORDER BY Right$([tbl_Security_Request]![Date_Logged],4) &
Mid([tbl_Security_Request]![Date_Logged],4,2);
SELECT Format(Date_Logged,"mm " & "mmm " & "yy") AS [Month],
Count(tbl_Security_Request_Citroen.Record_ID) AS [Security Requests]
FROM tbl_Security_Request_Citroen
WHERE (((tbl_Security_Request_Citroen.Date_Logged)>Now()-365))
GROUP BY Format(Date_Logged,"mm " & "mmm " & "yy"),
Right$([tbl_Security_Request_Citroen]![Date_Logged],4) &
Mid([tbl_Security_Request_Citroen]![Date_Logged],4,2)
ORDER BY Right$([tbl_Security_Request_Citroen]![Date_Logged],4) &
Mid([tbl_Security_Request_Citroen]![Date_Logged],4,2);
As you can see the queries aren't rocket science and I suspect I'm getting stuck on the syntax as much as anything. Any help or suggestions much appreciated
Thanks,
Andy
I've got two queries, one for a Peugeot franchise and one for a Citroen franchise. Apart from the table name they are the same query. But can I merge the two queries into one for a graph of grand totals? Nope! Anyone got any ideas? The two queries are listed below and I basically want to return the sum of these two queries i.e. one row of results to give me a "total" graph to accompany my Peugeot and Citroen graphs...
SELECT Format(Date_Logged,"mm " & "mmm " & "yy") AS [Month],
Count(tbl_Security_Request.Record_ID) AS [Security Requests]
FROM tbl_Security_Request
WHERE (((tbl_Security_Request.Date_Logged)>Now()-365))
GROUP BY Format(Date_Logged,"mm " & "mmm " & "yy"),
Right$([tbl_Security_Request]![Date_Logged],4) &
Mid([tbl_Security_Request]![Date_Logged],4,2)
ORDER BY Right$([tbl_Security_Request]![Date_Logged],4) &
Mid([tbl_Security_Request]![Date_Logged],4,2);
SELECT Format(Date_Logged,"mm " & "mmm " & "yy") AS [Month],
Count(tbl_Security_Request_Citroen.Record_ID) AS [Security Requests]
FROM tbl_Security_Request_Citroen
WHERE (((tbl_Security_Request_Citroen.Date_Logged)>Now()-365))
GROUP BY Format(Date_Logged,"mm " & "mmm " & "yy"),
Right$([tbl_Security_Request_Citroen]![Date_Logged],4) &
Mid([tbl_Security_Request_Citroen]![Date_Logged],4,2)
ORDER BY Right$([tbl_Security_Request_Citroen]![Date_Logged],4) &
Mid([tbl_Security_Request_Citroen]![Date_Logged],4,2);
As you can see the queries aren't rocket science and I suspect I'm getting stuck on the syntax as much as anything. Any help or suggestions much appreciated

Thanks,
Andy