Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Results Percentage

Author  Topic 

php95saj
Starting Member

43 Posts

Posted - 2002-07-24 : 07:13:27
I have a jobs table and I want to report on country of origin of clients. I store countryID in jobs table. Now I want to calculate something like this:
Argentina---------- 1----------1%
Canada ---------- 6----------3%
France ---------- 3----------2%
Germany ---------- 4----------2%
Mexico ---------- 1----------1%
UK ---------- 19----------10%
USA ----------137----------76%
etc..
Thank you.


rksingh024
Yak Posting Veteran

56 Posts

Posted - 2002-07-24 : 07:28:55
select countryid,
no_of_job,
cast(no_of_job*100/(select sum(no_of_job) from jobs) as varchar) + '%' as 'Percentage'
from jobs

Ramesh

Go to Top of Page

php95saj
Starting Member

43 Posts

Posted - 2002-07-24 : 07:36:14
sorry I should have put it this way. I want to report on client's origin in current month who had business. So the number are actually 1 client from Argentina which makes 1% of total, 6 clients from canada which makes 3% and so on...
So this does not represent no of jobs at all.

Go to Top of Page

rksingh024
Yak Posting Veteran

56 Posts

Posted - 2002-07-24 : 07:44:40
If you post your table structure and sample data then that will help us to understand the problem and you will get the proper solutions.

Ramesh

Go to Top of Page
   

- Advertisement -