By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

Divide the count of a query by total number of rows in the table

P: 1
I'm using Adventure Works 2005 as my sample database, and I'm trying to find the count of times the scheduled start date does not equal the actual start date divided by the total number of rows in the table to give me a percentage.

So far I have this.

select count (*) from [Production].[WorkOrderRouting]
where ScheduledStartDate!=ActualStartDate

I want to divide that count by the total number of rows in work order routing in one query

Thanks.
Sep 20 '13 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,349
Divide the count by a subquery that returns a full count.
Sep 20 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.