473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Counting combinations of check boxes

Hi
In my report I have data grouped by station. Some of the records have
check boxes checked to indicate whether the station was declared
available or unavailable at the time of incident, and whether they
were allowed to proceed.

I added a field to the query (qrycombined) that the report is based on
to calculate the following:

STATUS: IIf([CALL_NO] Is Null,0,IIf([DECLARED_AVAILABLE]=Yes And
[PROCEED]=Yes,1,IIf([DECLARED_AVAILABLE]=Yes And
[PROCEED]=No,2,IIf([DECLARED_AVAILABLE]=No And
[PROCEED]=No,3,IIf([DECLARED_AVAILABLE]=No And [PROCEED]=Yes,4,0)))))

In my report, I want to count all the 1s and all the 2s and all the 3s
and all the 4s separately for each station, and a final count for all
stations.
I have created a subreport, and have a formula which seems to do this
for all stations (in a text box):
=DCount("[STATUS]","qrycombined","[STATUS]=2") (similarly for 1,3,and
4)

But I can't figure out how to narrow that down to station. I tried to
change it to =DCount("[STATUS]","qrycombined","[STATUS]=2 AND
[STATION_CODE]=Reports!subreportfailures![STATION_CODE]") but that
gives an Error message. Am I on the right lines with this?

I can count the number of ticks in each field for each station which
works fine, using Sum, but this isn't what I want!. I'm sure it should
be obvious - hope it is to someone!

Thanks
Kirsty
Nov 13 '05 #1
1 1515
Cheat a little. False=0, True=-1, so....

SELECT tblLogins.Success, tblLogins.GetNZPage, tblLogins.FreezesNZ,
tblLogins.FreezesIE, ([success]+[getnzpage]+[freezesnz]+[freezesIE])*-1
AS CountOfYes
FROM tblLogins;
basically, you add all your Yes/No fields together, and then multiply
the result by -1 or take the absolute value .... so it SHOULD probably
be

SELECT tblLogins.Success, tblLogins.GetNZPage, tblLogins.FreezesNZ,
tblLogins.FreezesIE, ABS([success]+[getnzpage]+[freezesnz]+[freezesIE])
AS CountOfYes
FROM tblLogins;

might help if I told you that all the fields here are Yes/No....
Then base your report on that and you're off to the races.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
7
by: Micheal Artindale | last post by:
I am looking at creating list of letter combinations. letters a-h 6 letters per combination letter can repeat its self in the combination, but not next to its self and, a series of letter can...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
2
by: GrantMagic | last post by:
I have found that some strange combinations of characters in a URL can cause an error in my ASP.NET application. This is regarding URL Paramters For example: if i have the URL:...
6
by: Matt Chwastek | last post by:
Anyone who can help, I am curretnly attempting to write some code that will allow iteration using a vector<intfrom the highest possilbe degree of a combination of ones & zeros (111, 110, 101,...
27
by: Simon Biber | last post by:
I was reading http://en.wikipedia.org/wiki/Poker_probability which has a good description of how to count the frequency of different types of poker hands using a mathematical approach. A sample...
5
by: Bails | last post by:
Hi all I have a theory for a lotto system and need help on how to code it. I want to create 1 massive database with EVERY combination of numbers possible in a given lotto system, then remove all...
1
by: Java Kumar | last post by:
Hi Friends, I have a form which contains elements such as check boxes,text box,text area ., Problem is in Check boxes. By default, Check boxes are unchecked and text boxes...
4
prn
by: prn | last post by:
Hi folks, I've got another (inherited) puzzle that I don't understand. A report that I need to modify contains a subreport that lists a variable number of items in its detail section and then...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.