Hi there
I have a log table looking like:
ACTION DATE_TIME
1 31.03.2011 (Don't count because last month)
1 01.04.2011 (Count as new)
2 01.04.2011 (Count as new)
1 04.04.2011 (Count as new because there are at least 2 days since last new ACTION=1)
1 05.04.2011 (Don't count because since last new ACTION=1 there are not 2 days in between)
2 07.04.2011 (Count as new because there are at least 2 days since last new ACTION=2)
2 08.04.2011 (Don't count because since last new ACTION=2 there are not 2 days in between)
2 10.04.2011 (Count as new because there are at least 2 days since last new ACTION=2)
I need to count the number of ACTIONs within one calendar month (April 2011 in the example above).
The difficulty is that I only have to count them as new action when there are
at least 2 days between the first counted action and the next one.
So in the case of the example above I'd need to get as result:
NEW_ACTION COUNT
1 2
2 3
Thanks,
Peter