473,385 Members | 1,588 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,385 software developers and data experts.

Counting

When I try to count the number of checkboxes containing a check inside
I receive a negative number (-1) for each checked checkbox. This is in
a query.

What can I do to change my query so that a (-1) does not return as
counting one checked checkbox.

Here is my code:

SELECT [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date, Sum([Anonymous Callers].IsSpanishSpeaking)
AS SumOfIsSpanishSpeaking, Count([Anonymous Callers].[County Code
ID2]) AS [CountOfCounty Code ID2]
FROM [Anonymous Callers]
GROUP BY [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date;

Thanks for any ideas,

Zuf
Jun 27 '08 #1
1 1127
On May 7, 2:32*pm, zufie <john.marru...@illinois.govwrote:
When I try to count the number of checkboxes containing a check inside
I receive a negative number (-1) for each checked checkbox. This is in
a query.

What can I do to change my query so that a (-1) does not return as
counting one checked checkbox.

Here is my code:

SELECT [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date, Sum([Anonymous Callers].IsSpanishSpeaking)
AS SumOfIsSpanishSpeaking, Count([Anonymous Callers].[County Code
ID2]) AS [CountOfCounty Code ID2]
FROM [Anonymous Callers]
GROUP BY [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date;

Thanks for any ideas,

Zuf
Got it...

Here is my revised code:

SELECT [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date, Sum(-([IsSpanishSpeaking])) AS Expr1,
Count([Anonymous Callers].[County Code ID2]) AS [CountOfCounty Code
ID2]
FROM [Anonymous Callers]
GROUP BY [Anonymous Callers].CallerID, [Anonymous
Callers].IsSpanishSpeaking, [Anonymous Callers].[County Code ID2],
[Anonymous Callers].Date;
I added the expression: Expr1: Sum(-([IsSpanishSpeaking]))

to my above query

Thanks,

Zufie
Jun 27 '08 #2

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

Similar topics

6
by: Elbert Lev | last post by:
Please correct me if I'm wrong. Python (as I understand) uses reference counting to determine when to delete the object. As soon as the object goes out of the scope it is deleted. Python does...
1
by: ash | last post by:
hi does anyone has any experience with flyweight pattern with refernce counting i want to share objects between multiple clients and want to delete the object from shared pool when the last...
1
by: Tony Johansson | last post by:
Hello Experts! I reading a book called programming with design pattern revealed by Tomasz Muldner and here I read something that I don't understand completely. It says "A garbarage...
1
by: Tony Johansson | last post by:
Hello Experts! I reading a book called programming with design pattern revealed by Tomasz Muldner and here I read something that I don't understand completely. It says "A garbarage...
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...
7
by: zets | last post by:
I need a macro for counting the bits in the odd positions of a given input (of any type, char, pointer, int, struct, whatever). Is there any clever way I could not think of, to do it efficiently? ...
1
by: j | last post by:
Hi, I've been trying to do line/character counts on documents that are being uploaded. As well as the "counting" I also have to remove certain sections from the file. So, firstly I was working...
4
by: aaronfude | last post by:
Hi, Please consider the following class (it's not really my class, but it's a good example for my question): class Vector { int myN; double *myX; Vector(int n) : myN(n), myX(new double) { }...
1
by: oec.deepak | last post by:
Hi Cn any one telll me what is Reference counting in C++.
3
by: nitric | last post by:
hey guys, i'm really stuck on this program. It's basically a survey and I have to ask people what drinks they like. 1-4, coffee tea oj and lemonade. i'm having trouble counting the TOTAL NUMBER...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.