Solved

Help in Procedure

Posted on 2011-03-01
6
211 Views
Last Modified: 2012-05-11
hi expert

i need to develop the report based on the stored proc. I have attached the report sample .
My question is
i have to calculate total bid price=sum of all total price in the project.

For example in my attached report
My total bid price=total project=24.96+35.04+10+21=91

how to implement this in the above procedure.

i have attached two files
rpteBidProjectDetailCosting1.pdf
stored-proc-bidDetailCost.txt
0
Comment
Question by:sqlcurious
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:derekkromm
ID: 35010107
I'm a bit confused - where are you trying to put the total bid price in the proc? It seems to be calculating correctly on the report?

If you're just looking for how to return a single value for that, you'd just do:

 select sum(QI.QuoteItem_ItemTotalPrice * QI.QuoteItemQuantity) as 'Total Bid Price'
from
<insert the same from/where clauses from original stmt here>


0
 

Author Comment

by:sqlcurious
ID: 35010617
i want a separate column in the proc which calculates total bid price and total bid price is sum of total price for each division in the report sample.


 total bid price=24.96+35.04+10+21=91


so how to write query for that

please see the report sample.I need to develop new report like the sample
0
 
LVL 15

Expert Comment

by:derekkromm
ID: 35010710
So you would want $91 to show up as a column "TotalBidPrice" for every single row - with the same value for each row?

Because there's no "totals" row in this proc, correct? You're simply returning the data row set for the report.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:sqlcurious
ID: 35011183
yes

an you can see 24.96= sum of total price
                         35.01=sum of total price
                         10=sum of total price
                          21=sum of total price


so bid price= sum(sum of total price+
                         sum of total price+
                         sum of total price+
                          sum of total price+)=91
as an example
0
 
LVL 15

Accepted Solution

by:
derekkromm earned 500 total points
ID: 35011272
give this a try. it basically duplicates your FROM/WHERE clauses to get the total sum and cross joins it to your original query

i did this in notepad, so there might be a small syntax error somewhere i missed
stored-proc-bidDetailCost.txt
0
 

Author Comment

by:sqlcurious
ID: 35011429
yes it did works thanks
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now