Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / May 2008

Tip: Looking for answers? Try searching our database.

Counting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zufie - 07 May 2008 20:32 GMT
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
zufie - 07 May 2008 20:50 GMT
> 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
[quoted text clipped - 18 lines]
>
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.