Solved

Help in Procedure

Posted on 2011-03-01
6
219 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

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…
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

630 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