Advertisement

04.30.2008 at 12:36PM PDT, ID: 23366570
[x]
Attachment Details

How to group derived values in a select statement ?

Asked by stevejebson in MS SQL Server

Tags: microsoft, sql server, 2005

Hi Experts,

I have a table Transaction that is linked in  a one to many on TransactionLabourItem. Each TransactionLabourItem has a Qty and Rate so i can calculate the derived Cost as Qty * Rate, easy peasy

I'd like to write a select statement that returns 1 row per transaction that has a total Cost per Transaction but i can't group by Cost as it's derived and Sum would sum the whole table, i'm scratching my head here,  how do i do it ??

thanks in advance...Start Free Trial
 
 
[+][-]04.30.2008 at 12:41PM PDT, ID: 21473928

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.01.2008 at 09:50AM PDT, ID: 21480339

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: microsoft, sql server, 2005
Sign Up Now!
Solution Provided By: ScottPletcher
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628