How to Find the Date of Last Change in Inventory



If I have a table that lists a Style,Color, InventoryUnits, and
DateOfLastInventory, how can I find the last change in inventory? That
is, I wish to find Inventory that isn't moving.

For example, let's say I have the following in a table:

Style Color Units Date
1912 White 200 01/25/05
1912 White 50 02/28/05
1912 White 38 03/15/05
1912 White 200 05/01/05
1912 White 200 06/01/05
1912 White 200 06/15/05

I wish to get:

Style Color Units Days
1912 White 200 45

Or 45 days between 5/1/ and 6/15 (though it could obviously be more
days, that is the number I want).

And if I have this:

2012B Pink 415 01/25/05
2012B Pink 248 02/28/05
2012B Pink 111 03/15/05
2012B Pink 111 05/01/05
2012B Pink 111 06/01/05
2012B Pink 111 06/15/05

I wish to get:

Style Color Units Days
2012B Pink 111 90

And if I have just two dates *with* a change in inventory, or if I have
only one record for a style/color, it should return 0 days.

Thanks,

Matt

.



Relevant Pages


Loading