kermitforney
Technical User
I have a query I have been working on that I am trying to code to calculate duration of time. Need a bit of help and any and all wil be appreciated.
Ex.
UID|Date|Toy|Out of Stock
001|1/1/2009|Balls|Yes
002|1/3/2009|Balls|Yes
003|1/5/2009|Balls|Yes
004|1/2/2009|Straws|Yes
005|1/3/2009|Straws|No
006|1/4/2009|Straws|Yes
So, what I need is for the query to filter via out of stock (which I already understand), but return only sets of data with consecutive dates of out of stock items.
Ex.
001|1/1/2009|Balls|Yes
002|1/3/2009|Balls|Yes
003|1/5/2009|Balls|Yes
Balls| Out of stock from 1/1/2009 through 1/5/2009.
Ex.
004|1/2/2009|Straws|Yes
005|1/3/2009|Straws|No
006|1/4/2009|Straws|Yes
Straws do not qualify because their out of stock status was not consecutive.
I hope I explained this thouroughly.
Thanks in advance for any/all responses.
Ex.
UID|Date|Toy|Out of Stock
001|1/1/2009|Balls|Yes
002|1/3/2009|Balls|Yes
003|1/5/2009|Balls|Yes
004|1/2/2009|Straws|Yes
005|1/3/2009|Straws|No
006|1/4/2009|Straws|Yes
So, what I need is for the query to filter via out of stock (which I already understand), but return only sets of data with consecutive dates of out of stock items.
Ex.
001|1/1/2009|Balls|Yes
002|1/3/2009|Balls|Yes
003|1/5/2009|Balls|Yes
Balls| Out of stock from 1/1/2009 through 1/5/2009.
Ex.
004|1/2/2009|Straws|Yes
005|1/3/2009|Straws|No
006|1/4/2009|Straws|Yes
Straws do not qualify because their out of stock status was not consecutive.
I hope I explained this thouroughly.
Thanks in advance for any/all responses.