I have a stored procedure that prorates quantities based on either a contract start date, contract end date, or an order requested delivery date.
A sales contract is also referred to as a "blanket" type
A regular sales order is a "standard" type
Sales Contracts use Contract Start and End date to do prorate calculation
Regular Sales Orders use the Requested Delivery Date to do prorate calculation
Right now the results are in tabular format all quantities summed up
Bu I need a way to figure out how to split the pro-ration calculation and the quantities by month.
I am including a copy of my t-sql and also a copy of some sample data I am using to test.
I hope that by looking at these files, what I am trying to accomplish becomes clearer than my description of my problem.
I hope also, someone can have the time to offer a hand on working on this, because I am clueless how to do this type of pivot, with calculation.
All the formulas are included, any question, please shoot.
Thank you much.