Consecutive Date Query

T

T

I have a datebase where im trying to display employees who have taken consecutive Vacation time.(3 or more days). The table has the below data(emplyee ID, Name, Startdate, Enddate). Im thinking I may have to write a function, but would like to keep it as a query

Data:
1,Jon Jones, 2/28
1,Jon Jones, 2/29
1,Jon Jones, 2/30
1,Jon Jones, 5/28
1,Jon Jones, 5/29
1,Jon Jones, 5/30
2, Jill Jones 5/15
2, Jill Jones 5/16
2, Jill Jones 5/17
2,Jill Jones, 5/28
2,Jill Jones, 5/29
2,Jill Jones, 5/30

Results should be:
1,Jon Jones, 2/28, 2/30
1,Jon Jones, 5/28, 5/30
2,Jill Jones, 5/15, 5/17
2,Jill Jones, 5/28, 5/30

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
K

kingston via AccessMonster.com

I'm sorry but I don't see how you can do this without any code or a
complicated series of queries. You can do this somewhat easier in Excel
because it allows comparison with the other records (e.g. if cell <> previous
cell + 1then "Start" and if cell <> next cell - 1 then "End"). In any event,
you may have to figure out how to deal with weekends and holidays.
 

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