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.