Morning/Afternoon all...
Can some one tell me how i can age records,
I have 4 years worth of data which needs to be flagged into 4 categories:
3-6 mths
6-12 mths
>12 mths old.
I then need to apply a set of rules to the above.
Thought i could use something like
(MONTH(traffic_month) = MONTH(GETDATE())-2) OR
( MONTH(traffic_month) = MONTH(GETDATE())-3) OR
( MONTH(traffic_month) = MONTH(GETDATE())-4)
but hit problems when moving across years....
Any help greatfully received.
Cheers
Can some one tell me how i can age records,
I have 4 years worth of data which needs to be flagged into 4 categories:
3-6 mths
6-12 mths
>12 mths old.
I then need to apply a set of rules to the above.
Thought i could use something like
(MONTH(traffic_month) = MONTH(GETDATE())-2) OR
( MONTH(traffic_month) = MONTH(GETDATE())-3) OR
( MONTH(traffic_month) = MONTH(GETDATE())-4)
but hit problems when moving across years....
Any help greatfully received.
Cheers