• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

help in stored proc

need to rewrite the query adding following formula in the attached procedure


(Total bid price- sum of total costs -total base freight)/sum of total costs  *100


Total bid price= sum (QI.QuoteItemQuantity * QI.QuoteItem_ItemTotalPrice ) from the select statement.

how to implement this in the attached stored proc

I need to build the reports based on this
  • 2
1 Solution
SharathData EngineerCommented:
Can you post the sample output of your proc and expected additional columns?
sqlcuriousAuthor Commented:
the markup percent is taken directly from the column .Now i want to implement it using procedure similarly for total freight too.

i want additional margin column which has following formula

(total bid price)-(sum of total cost)-(total base freight)/(total bid price)*100

where total base freight=total freight
and sum of total costs=total costs
sqlcuriousAuthor Commented:
no solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now