Awkward query with dates!

L

Leslie Isaacs

Hello All

I have a table [absences], with fields 'absencedate' (a date/time filed),
'absencetype' (a 1-character text field) and 'employeename' (text). Each
record represents one day of absence.

Where any two absence periods (which may be 1 or more consecutive days) are
seperated by 8 weeks or less, they are considered 'linked'. Thus any number
of absence periods could all be linked if the maximun gap between
consecutive periods is 8 weeks or less.

I need a query that will return, for any newly-entered absence period start
date, the total number of absence days that have occured for the selected
employee, where 'absencetype' ="W", within any absence periods that are
'linked' to the newly-entered absence period start date.

I'm sure this should be quite simple, but I cannot seem to get it ... and
now my brain is dying!

Hope someone can help.
Many thanks
Leslie Isaacs
 
J

John Spencer

Actually, that looks to me as if it would be quite difficult to do since you
(in theory) have no limit to the chain of dates.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top