SQL Server - I need to create a stored procedure where in I have to accept the date range from the user

Asked By Akhilesh Bhagwani on 15-Feb-20 12:21 PM
I have to create a stored procedure where in I have to accept the date range from the user for selling period and calculate the profit of sale of a given car on any date of the year.

Clauses 

Price decrease 3 % per week after end of selling date
Car will never be sold for less than the cost
Big cars increase 5% percent after selling season
Price of red cars decrease 2% week


I have one table that has the following columns
Brand  | Style | Color | Cost | Retail Price|

I'm planning to create a temporary table and input the user date ranges and car sale date using a stored procedure..however I'm now stuck with how will I calculate the profit on sale for any car on a given date of the year.

Can you please suggest ?