Solved

Help in Procedure

Posted on 2011-03-01
6
213 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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