Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help in Procedure

Posted on 2011-03-01
6
Medium Priority
?
220 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

730 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