Hello guys,
I need some help. I'm doing a project that calculates what was missing in the warehouse but I'm stuck a bit. I will describe what i want to achieve.
I have a table with the fields.
1. Date
2. Freebalance
The Date field contains of every day for a period that i specify so for example if i specify 2010.06.01 - 2010.06.30 it will list me day by day of the month 06
The field Freebalance contains of a qty of some kind of warehouse goods.
Example:
Date Freebalance
2010.06.01 10
2010.06.02 15
2010.06.03 25
2010.06.04 85
2010.06.05 40
2010.06.06 25
2010.06.07 30
2010.06.08 58
2010.06.09 87
2010.06.10 0
2010.06.11 25
2010.06.12 58
2010.06.13 47
2010.06.14 58
2010.06.15 58
2010.06.16 44
2010.06.17 19
2010.06.18 0
2010.06.19 -10
2010.06.20 -10
2010.06.21 -25
2010.06.22 15
2010.06.23 14
2010.06.24 25
2010.06.25 4
2010.06.26 -67
2010.06.27 -154
2010.06.28 - -300
2010.06.29 -500
2010.06.30 - 1600
I want to write a procedure which could count me the number of intervals this good was out of stock(out of stock means it was<=0)
i can see that by the date 2010.06.10 this was 0 and next day it was on stock again so it means the counter of missing intervals is 1
Next i can see that by the date 2010.06.18 it again set to 0 but i can see that it back to stock 2010.06.22. So it means that it is again an interval of missing(2010.06.18 - 2010.06.21). So now i plus the counter i i already have 2 intervals.
Next i see that it is out of stock starting 2010.06.26 and till the end of my analyzing period is out also(2010-06.26-2010.06.30). So the counter is set to 3.
So it means whern i analyze the period for 2010.06.01-2010.06.30 for that good i have to get result of missing intervals 3.
Any help would be greatful.
Thanks
I need some help. I'm doing a project that calculates what was missing in the warehouse but I'm stuck a bit. I will describe what i want to achieve.
I have a table with the fields.
1. Date
2. Freebalance
The Date field contains of every day for a period that i specify so for example if i specify 2010.06.01 - 2010.06.30 it will list me day by day of the month 06
The field Freebalance contains of a qty of some kind of warehouse goods.
Example:
Date Freebalance
2010.06.01 10
2010.06.02 15
2010.06.03 25
2010.06.04 85
2010.06.05 40
2010.06.06 25
2010.06.07 30
2010.06.08 58
2010.06.09 87
2010.06.10 0
2010.06.11 25
2010.06.12 58
2010.06.13 47
2010.06.14 58
2010.06.15 58
2010.06.16 44
2010.06.17 19
2010.06.18 0
2010.06.19 -10
2010.06.20 -10
2010.06.21 -25
2010.06.22 15
2010.06.23 14
2010.06.24 25
2010.06.25 4
2010.06.26 -67
2010.06.27 -154
2010.06.28 - -300
2010.06.29 -500
2010.06.30 - 1600
I want to write a procedure which could count me the number of intervals this good was out of stock(out of stock means it was<=0)
i can see that by the date 2010.06.10 this was 0 and next day it was on stock again so it means the counter of missing intervals is 1
Next i can see that by the date 2010.06.18 it again set to 0 but i can see that it back to stock 2010.06.22. So it means that it is again an interval of missing(2010.06.18 - 2010.06.21). So now i plus the counter i i already have 2 intervals.
Next i see that it is out of stock starting 2010.06.26 and till the end of my analyzing period is out also(2010-06.26-2010.06.30). So the counter is set to 3.
So it means whern i analyze the period for 2010.06.01-2010.06.30 for that good i have to get result of missing intervals 3.
Any help would be greatful.
Thanks