query sum

S

SoggyCashew

Hello, I have a table that has 3 fields ANI, First Aid, and Confirmation 1st
Aid. these 3 fields are in Yes/No format. I want to create a query the will
give me a sum for each of one of these fields by a date range but how would I
do this due to the Yes/No format.
 
J

John Spencer

The SQL for the query might look something like the following.

SELECT Abs(Sum(ANI)) as CountANIChecked
, Abs(Sum([First Aid])) as CountFirstAidChecked
, Abs(Sum(Confirmation)) as CountConfirmationChecked
FROM [Your Table]
WHERE [SomeDateField] Between #2008-01-01# and #2008-06-30#


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
J

John Spencer

The SQL for the query might look something like the following.

SELECT Abs(Sum(ANI)) as CountANIChecked
, Abs(Sum([First Aid])) as CountFirstAidChecked
, Abs(Sum([Confirmation First Aid])) as CountConfirmationChecked
FROM [Your Table]
WHERE [SomeDateField] Between #2008-01-01# and #2008-06-30#


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top