gRegulator
Technical User
I have the following SQL Query:
I have been trying to put in date parameters but I have been out of luck. I have tried putting in the following:
[Admit] comes from qry_q31_offence_types and is a date field.
Basically, I want to have all records that were entered from this time frame be counted in the query. I think I am doing it right, but I never seem to get the right result, or I get an error saying the query is too complicated.
I am very confused right now, can anyone help?
Thanks
Code:
SELECT qry_q31_offence_types.Offence, -Sum([Male]) AS [Male Clients], -Sum([Female]) AS [Female Clients]
FROM qry_q31_offence_types
GROUP BY qry_q31_offence_types.Offence;
I have been trying to put in date parameters but I have been out of luck. I have tried putting in the following:
Code:
PARAMETERS [Start] DateTime, [End] DateTime;
SELECT qry_q31_offence_types.Offence, -Sum([Male]) AS [Male Clients], -Sum([Female]) AS [Female Clients]
FROM qry_q31_offence_types
WHERE [Admit] Between [Start] AND [End]
GROUP BY qry_q31_offence_types.Offence;
[Admit] comes from qry_q31_offence_types and is a date field.
Basically, I want to have all records that were entered from this time frame be counted in the query. I think I am doing it right, but I never seem to get the right result, or I get an error saying the query is too complicated.
I am very confused right now, can anyone help?
Thanks