Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiply Count of Rows by Value Held in Field

Status
Not open for further replies.

zulu1ghz

Technical User
Sep 10, 2002
19
0
0
GB
Hi All,

I'm trying to work out if this is possible as all my current attempts at this have failed.

I have written a query which shows me how many people have attended a course, one of the columns counts the number of people and returns the count correctly.

Now another one of my fields holds the course duration in days, i.e 1,2,3 etc. What I want to be able to do is create an expression that will multiply the count of people on the course by the duration giving me a total of man days consumed by staff attending the course.

Could anybody point me in the right direction of this expression or if it's possible at all. I can do a count and then multiple it by a number. For example:-

select count(*)* 200 from ps_training will work.

However if i include other fields in the select i receive a message about it being not a single group function.

Thanks in advance.
Steve
 


hi,
However if i include other fields in the select i receive a message about it being not a single group function.
Code:
select count(*)* 200 , [some other field]
from ps_training[b]
Group By [some other field][/b]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks guys for the prompt response.

Worked a treat.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top