Getting a query on multiple checkbox fields to work with a date range

oilrigjim

New member
Local time
Today, 04:07
Joined
Nov 8, 2014
Messages
2
I have developed a database which has required many checkbox fields to enable analysis. It requires to have the facility to input random/variable date ranges for statistical purposes.

I have built a query which obtains the counts of multiple fields using the following parameters in Query Builder in Access 2010. Although this comes up with the correct results for these multiple fields when I try introduce date range the results come up blank for all results.

An example of the parameters used for one of the checkbox fields in Query Builder is as follows:

Field: SumAnger: Sum([Anger]*-1)
Table: Default as only one table
Total: Expression
Show: Checked

This works fine.
My latest parameters for the date range are this:

Field: [cDate]
Table: Default as only one table
Total: WHERE Corrected! Whoops Copy & Paste Typo. Too early AM!
Show: Checked or Unchecked makes no difference
Criteria: Between [From Date:] And [To Date:]

This gives a statement in SQL view of:

SELECT Sum([Anger]*-1) AS SumAnger, Sum([Anxiety]*-1) AS SumAnxiety, Sum([Depression]*-1) AS SumDepression, Sum(
[Listening]*-1) AS SumListenig, Sum([Psychosis]*-1) AS SumPsychosis, Sum([Stress]*-1) AS SumStress, Sum([Other]*-1) AS SumOther, tblCommsLog.[cDate]
FROM tblCommsLog
WHERE (((tblCommsLog.[cDate]) Between [From Date:] And [To Date:]));

Does anyone know what I need to get this to work in Query Builder or failing that recommend some VBA script/code with embedded SQL to achieve the required report.

Regards All Oilrigjim
 
Last edited:
SOLVED!

Apologies!! Query WAS working but I had been up so long (36 Hrs+) working on all aspects of the database that I was entering 2013 and not 2014 for the year.

Shamefaced start on the Forum.

Again Regards to All and further apologies for not doing the introduction I was just too beat to find the correct button to push.
 

Users who are viewing this thread

Back
Top Bottom