HeathRamos
IS-IT--Management
I have a table that contains the following info:
Employee number, date and a number field (containing a value between 0.25 and 1).
I need a query that returns the sum of the past 12 months (current date minus one year) but also need the following:
If there is a gap of more than 90 days, subtract one from the total. In other words, if the date field were sorted, check for how many days inbetween entries. after which for the ones above 90 days, subtract one from the total, if any of those are about 120, subtract 2 from the total and if any are above 270, subtract 3 (without going below 0, of course).
I hope this makes sense.
Employee number, date and a number field (containing a value between 0.25 and 1).
I need a query that returns the sum of the past 12 months (current date minus one year) but also need the following:
If there is a gap of more than 90 days, subtract one from the total. In other words, if the date field were sorted, check for how many days inbetween entries. after which for the ones above 90 days, subtract one from the total, if any of those are about 120, subtract 2 from the total and if any are above 270, subtract 3 (without going below 0, of course).
I hope this makes sense.