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

Sql query..... Sum of another aggragate function

SELECT Category, COUNT(Labour_ID) AS LabourCount FROM
HR_Labours
WHERE (Absconded = '0') AND (VisaCancelled = '0') AND (OnLeave =
'0') AND (Terminated = '0')
GROUP BY Category


here i reading count of labours under this criteria .... as lzbour
count ..for each category...but
i need the total count means SUM of labourcout[LabourCount ] ...

i can i write this as SUM(count(Labour_ID))
or ho i will get the sum...
plz help me

Apr 24 '06 #1
1 1019
Philip,

As I understand you right, with a command.executescalar

http://msdn2.microsoft.com/en-us/lib...ar(VS.80).aspx

I hope this helps,

Cor

"Coool.Net" <is*******@gmail.com> schreef in bericht
news:11**********************@t31g2000cwb.googlegr oups.com...
SELECT Category, COUNT(Labour_ID) AS LabourCount FROM
HR_Labours
WHERE (Absconded = '0') AND (VisaCancelled = '0') AND (OnLeave =
'0') AND (Terminated = '0')
GROUP BY Category


here i reading count of labours under this criteria .... as lzbour
count ..for each category...but
i need the total count means SUM of labourcout[LabourCount ] ...

i can i write this as SUM(count(Labour_ID))
or ho i will get the sum...
plz help me

Apr 24 '06 #2

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

Similar topics

2
by: lawrence | last post by:
A very strange bug. www.monkeyclaus.org is run by a cms I'm developing. One of types of users we allow is "justTestingTheSite", a type of user I developed to give demo's to prospective clients. The...
0
by: Phil Powell | last post by:
I have a very simple mySqlQuery object that takes two parameters: 1) the string query 2) the db connection resource I tested and was certain everything is passing correctly (the string query...
1
by: muelli75 | last post by:
Hi! Im getting insane by solving a problem .... I try to define a function which uses a code-snippet from another file. My base are the codes from the great book "WebDataBase-Book by H....
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
1
by: hmiller | last post by:
I'm sorry to populate the server with yet another question about linking multiple tables and queries, howerver I have not been able to find the right criteria. My problem. I am trying to...
11
by: Andy_Khosravi | last post by:
My problem: I'm having trouble with a query taking much too long to run; a query without any criteria evaluating only 650 records takes over 300 seconds to run (over the network. On local drive...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
0
by: Doranj00 | last post by:
Hello Everyone, Its been awhile since developing SQL code and I have a dilemma. Now, I can think of several ways to get what I need, BUT the important thing is that I need the optimized way to...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.