S
stuckness
Im tring to categorise some records based on a rule which says;
we have a 2 hour grace period, then every thing is categorised different.
we have a bunch of duration values, ie 2hr, .25hr, 1 hr, whatever.
If the event is over 2 hours- then it is category 2.
if we have 1.5hr first, then we have .5hr left of grace- anything longer
will be cat2.
ie, this is what i want the query to return....
..5hr -grace period (first .5hr grace used)
3hrs - cat2
1hr -grace period (now total grace is 1.5hrs)
2hrs -cat2
1hr - cat2 (because now we have only .5hr grace left)
..5hr -grace (now all 2hrs grace is used everything needs to be cat2)
this is driving me nuts- any help appreciated...
we have a 2 hour grace period, then every thing is categorised different.
we have a bunch of duration values, ie 2hr, .25hr, 1 hr, whatever.
If the event is over 2 hours- then it is category 2.
if we have 1.5hr first, then we have .5hr left of grace- anything longer
will be cat2.
ie, this is what i want the query to return....
..5hr -grace period (first .5hr grace used)
3hrs - cat2
1hr -grace period (now total grace is 1.5hrs)
2hrs -cat2
1hr - cat2 (because now we have only .5hr grace left)
..5hr -grace (now all 2hrs grace is used everything needs to be cat2)
this is driving me nuts- any help appreciated...