SQLServerCentral Article

TSQL Challenge 39 - Calculate Gross Profit by Item using FIFO method

,

This challenge is related to an inventory management application where your job is to calculate the profitability by item (cost v/s sales) using First-In-First-Out (FIFO) processing method.

The inventory application has a table that stores the purchase information with the cost and another table that stores the sales details. You need to calculate the profit earned by each sales by calculating the differences between purchase cost and sales price. If an item is purchased more than once, it is assumed that the oldest stock will be sold first.

http://beyondrelational.com/blogs/tc/archive/2010/09/20/tsql-challenge-39-calculate-gross-profit-by-item-using-fifo-method.aspx

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating