G
Guest
I have a database of jobs that are performed on a regular basis. Once a week
I need to print out any job that is due. I know the date the jobs were
entered [Start] in the DB, the interval in days that they need to be
performed [Interval], and I prompt the user for a report date [RD] for the
group of reports. I'd like to print out anything that falls into this 7 day
window. I cannot come up with a good selection criterion.
I noticed that if you take the integer part of the expression ([Start] –
[RD]) / [Interval]) and compare it to the integer part of the same thing 7
days later, ([Start] – [RD] + 7 / [Interval]), the two will be equal if the
report is not due and unequal when it is due. In other words the interval
has rolled over during the week in question.
Thus, if the following expression is true then the reports are due.
INT ([Start] – [RD]) / [Interval] <> INT ([Start] – [RD] + 7) / [Interval]
I just can’t figure out a way to put this into a selection query. Anybody
have any ideas?
I need to print out any job that is due. I know the date the jobs were
entered [Start] in the DB, the interval in days that they need to be
performed [Interval], and I prompt the user for a report date [RD] for the
group of reports. I'd like to print out anything that falls into this 7 day
window. I cannot come up with a good selection criterion.
I noticed that if you take the integer part of the expression ([Start] –
[RD]) / [Interval]) and compare it to the integer part of the same thing 7
days later, ([Start] – [RD] + 7 / [Interval]), the two will be equal if the
report is not due and unequal when it is due. In other words the interval
has rolled over during the week in question.
Thus, if the following expression is true then the reports are due.
INT ([Start] – [RD]) / [Interval] <> INT ([Start] – [RD] + 7) / [Interval]
I just can’t figure out a way to put this into a selection query. Anybody
have any ideas?