troubleshooting Question

Create Stored Procedure- Subtotal Strings

Avatar of TCIrish675
TCIrish675 asked on
Microsoft SQL Server
12 Comments1 Solution415 ViewsLast Modified:
I'm new to SQL Server and this is probably pretty simple but I really don't know.
I have a table (with among other things) Job Number(string), Job Line Number(string),Sales Price by Line number (string).
Ex. in field Job Number, 100 (string) Line Number, 001(string)  Sales Price,  200.00(string)
               Job Number, 100  (string) Line Number, 002(string)  Sales Price, 150.00(string)
               Job Number, 100 (string)                              Total Sales Price, 350.00 (string or number)
I want the Total Sales Price by Job Number to be in a field where i can select it with a Crystal Report. I've been told I can accomplish this with a stored procedure. How do I create a stored procedure that will total the Sales Price string(s) based on Job Number?
I'm not doing this in Crystal because I want to sort by and select nthlargest based on the Total Sales Price and I haven't been able to do that in Crystal Reports with Summaries or Running Totals.

Any suggestions would be appreciated.

Thanks!

TC
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros