Solved

Help in Procedure

Posted on 2011-03-01
6
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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