Click here to Skip to main content
15,890,336 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to order Integer field as a string ?? Pin
Aswanikumarj20-Feb-07 3:45
Aswanikumarj20-Feb-07 3:45 
GeneralRe: How to order Integer field as a string ?? Pin
kindman_nb20-Feb-07 5:05
kindman_nb20-Feb-07 5:05 
AnswerRe: How to order Integer field as a string ?? Pin
andyharman20-Feb-07 3:46
professionalandyharman20-Feb-07 3:46 
GeneralRe: How to order Integer field as a string ?? Pin
kindman_nb20-Feb-07 5:07
kindman_nb20-Feb-07 5:07 
QuestionSQL server does not exists or access denied. Pin
Aswanikumarj20-Feb-07 3:06
Aswanikumarj20-Feb-07 3:06 
AnswerRe: SQL server does not exists or access denied. Pin
Krish - KP20-Feb-07 17:11
Krish - KP20-Feb-07 17:11 
GeneralRe: SQL server does not exists or access denied. Pin
Aswanikumarj28-Feb-07 6:02
Aswanikumarj28-Feb-07 6:02 
QuestionAverage of all columns Pin
Sam Heller20-Feb-07 1:55
Sam Heller20-Feb-07 1:55 
I have a table where each row list's the product id and then 9 individual statistical percentage value relevant to that product. I need to create a final column to average all percentages into one overall score as well.

Any suggestions on how to do this?


The main select part of this code is below. Thanks in advance

SELECT ProductID, <br />
	-- Calculate Speed percentage<br />
	CONVERT(decimal(18, 2), @BestSpeed / (SELECT AVG(Finalised) FROM Leads WHERE Finalised IS NOT NULL AND ProductID = P.ProductID) * 100) As [Speed],<br />
	--Actual speed value<br />
	(SELECT AVG(Finalised) FROM Leads WHERE Finalised IS NOT NULL AND ProductID = P.ProductID) As [Actual Speed],<br />
	-- Calculate APR value percentage<br />
	CONVERT(decimal(18, 2), @BestAPR / (SELECT AVG(APR) FROM Leads WHERE APR IS NOT NULL AND ProductID = P.ProductID) * 100) As [APR],<br />
	-- Actual APR value<br />
	(SELECT AVG(APR) FROM Leads WHERE APR IS NOT NULL AND ProductID = P.ProductID) As [Actual APR],<br />
	-- Calculate Broker Fee percentage<br />
	CONVERT(decimal(18, 2), @BestBrokerFee / (SELECT AVG(BrokerFee) FROM Leads WHERE BrokerFee IS NOT NULL AND ProductID = P.ProductID) * 100) As [BrokerFee],<br />
	-- Actual APR value<br />
	(SELECT AVG(BrokerFee) FROM Leads WHERE BrokerFee IS NOT NULL AND ProductID = P.ProductID) As [Actual BrokerFee],

AnswerRe: Average of all columns Pin
andyharman20-Feb-07 3:44
professionalandyharman20-Feb-07 3:44 
GeneralRe: Average of all columns Pin
Sam Heller20-Feb-07 5:09
Sam Heller20-Feb-07 5:09 
AnswerRe: Average of all columns Pin
andyharman20-Feb-07 22:40
professionalandyharman20-Feb-07 22:40 
QuestionSQL Server 2000 Installation problem on Windows server 2003 Pin
Gulfraz Khan20-Feb-07 1:51
Gulfraz Khan20-Feb-07 1:51 
AnswerRe: SQL Server 2000 Installation problem on Windows server 2003 Pin
Smart_Boy13-Mar-07 19:14
Smart_Boy13-Mar-07 19:14 
GeneralRe: SQL Server 2000 Installation problem on Windows server 2003 Pin
Gulfraz Khan14-Mar-07 5:49
Gulfraz Khan14-Mar-07 5:49 
QuestionNull values Pin
gauthee20-Feb-07 0:33
gauthee20-Feb-07 0:33 
AnswerRe: Null values Pin
andyharman20-Feb-07 0:35
professionalandyharman20-Feb-07 0:35 
GeneralRe: Null values Pin
gauthee20-Feb-07 0:45
gauthee20-Feb-07 0:45 
GeneralRe: Null values Pin
Colin Angus Mackay20-Feb-07 0:55
Colin Angus Mackay20-Feb-07 0:55 
GeneralRe: Null values Pin
gauthee20-Feb-07 1:20
gauthee20-Feb-07 1:20 
QuestionDatatype? Pin
Sam Heller19-Feb-07 22:35
Sam Heller19-Feb-07 22:35 
AnswerRe: Datatype? Pin
Krish - KP19-Feb-07 23:00
Krish - KP19-Feb-07 23:00 
GeneralRe: Datatype? Pin
Sam Heller20-Feb-07 1:52
Sam Heller20-Feb-07 1:52 
Questionsql server doesnt allow remote connections![.NET2 sqlserv05exp] Pin
giddy_guitarist19-Feb-07 21:43
giddy_guitarist19-Feb-07 21:43 
AnswerRe: sql server doesnt allow remote connections![.NET2 sqlserv05exp] Pin
Colin Angus Mackay19-Feb-07 23:55
Colin Angus Mackay19-Feb-07 23:55 
AnswerRe: sql server doesnt allow remote connections![.NET2 sqlserv05exp] Pin
andyharman20-Feb-07 0:08
professionalandyharman20-Feb-07 0:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.