473,398 Members | 2,368 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,398 software developers and data experts.

Is there a way to total a "Count" column in the same SQL statement

1. My problem:
I am using a query to populate a Chart in MS Access 2k.

2. My query:
SELECT [3875 Open Item Status].Status, [Status Description].[Status
Description], Sum([3875 Current Open Items].Amount) AS SumOfAmount,
Sum(IIf([3875 Current Open Items]![Debit/Credit]="Debit",[3875 Current
Open Items]![Amount],[3875 Current Open Items]![Amount]*-1)) AS
realAmount, Count([3875 Open Item Status].Status) AS CountOfStatus
FROM ([3875 Open Item Status] INNER JOIN [Status Description] ON [3875
Open Item Status].Status = [Status Description].[Status Number]) INNER
JOIN [3875 Current Open Items] ON ([3875 Open Item Status].[Sch Num] =
[3875 Current Open Items].[Schedule Number]) AND ([3875 Open Item
Status].[Post Date] = [3875 Current Open Items].EffectiveDate)
WHERE ((([3875 Current Open Items]![EffectiveDate]) Between #10/1/2001#
And #9/30/2005#) AND (([3875 Open Item Status].Status)<>13 And ([3875
Open Item Status].Status)<>15))
GROUP BY [3875 Open Item Status].Status, [Status Description].[Status
Description]
ORDER BY Count([3875 Open Item Status].Status);
3. Here is the data returned from my query:

Status Description SumOfAmount NetAmount StatusCount
11 FBWT Balance Entry $20.00 $20.00 1
8 Closed Award $126,237.44 ($126,237.44) 2
12 ADI Error $7,591.00 $599.00 5
9 FUND 2915 SQL Needed $105,054.79 ($105,054.79) 6
14 Incomplete DV $174,501.44 ($174,501.44) 7
6 Oracle Reversed $25,707.51 ($25,707.51) 8
5 Over-Applied $12,504.15 ($9,871.65) 12
4 GAPs Reversed $52,389.81 $28,415.29 23
2 PreConversion $1,147,998.20 $1,147,998.20 105

4.All I need is a "Sum" or "Count" of the StatusCount Column
(which is a count of occurences of the Status Column). I am
new to Access and have searched thru the Access help file and
web for help but have found no answers. Can anyone help?

Thanx,
Chris

Nov 13 '05 #1
0 1476

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

Similar topics

1
by: Tracey | last post by:
in my procedure, I want to count the number of rows that have errored during an insert statement - each row is evaluated using a cursor, so I am processing one row at a time for the insert. My...
1
by: Son KwonNam | last post by:
When I try <xsl:value-of select="count('/GROUPS/GROUP')"/> on JSTL <x:transform> tag, I got the following error message. org.apache.jasper.JasperException: Can not convert #STRING to a NodeList!...
1
by: James | last post by:
Access 2003, trying to count the number of records that meet a criteria. According to Help: "In the Database window, click Queries under Objects, and then click New on the database window...
3
by: Rabun | last post by:
Heres one that is giving me fits ( = = Access newbie), more than likely something simple that I blew right over . . . any help is appreciated - I have a report based on a query, with several...
5
by: ygao | last post by:
my question is as title! thanks!
9
blyxx86
by: blyxx86 | last post by:
Hey guys, I know it's possible, but I do not know how to do this... I am looking for a way to count the total number of rows returned in a subform or a query. Similar to the way an Excel...
2
by: Jschraepf | last post by:
I'm working in visual web developer and i want to use the results of a count query but i don't know how to get them. I am using a select statment: SELECT Count(Record) From " &...
4
by: whatsuppussycat | last post by:
I want to be able to SUM the values returned using the TOP 5 and COUNt statements. So far I've tried from many angles and can't get it to work, very frustrating! Here is my code: SELECT TOP 5...
5
by: gflor16 | last post by:
Problem: I have this code to run a word counter. But I have a problem when I hit the enter key, it doesn't give me any output of how many chars or words. ''' <summary> ''' Returns Word...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.