November 29, 2021 at 6:14 pm
It's preferred to copy-paste schemas, code etc into your post instead of as an attachment. Many of us don't open attachments due to virus risks. Use the "Insert/Edit code sample" option.
November 29, 2021 at 6:26 pm
Hi,
Sorry rookie mistake, I edited the post to show the table info, hopefully that helps..Thanks
November 29, 2021 at 6:32 pm
Ignore "code" and GROUP BY on Company ID# ?
November 29, 2021 at 8:02 pm
Hi,
Sorry rookie mistake, I edited the post to show the table info, hopefully that helps..Thanks
You've been around long enough to know this. In my signature is a link that provides instructions.
Does this work?
WITH CTE
AS
(
SELECT
YEAR,
COmpany,
CompanyID,
Sum(TotalAmount), TotalAmount
MAX(Bid_Limit) BidLimit
FROM Table
GROUP BY
YEAR,
COmpany,
CompanyID
)
SELECT
YEAR,
COmpany,
CompanyID,
TotalAmount,
BidLimit.
BidLimit - TotalAmount Results
FROM CTE
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
November 29, 2021 at 8:15 pm
Thank you.. Really appreciate the help...
Viewing 5 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply