group by problems

J

john

Hi All,

I shall try to explain this group by as best I can. I
have a database that stores information on peoples
itineraries and I am trying to produce a summary of where
they need to be. I was hoping to do this using the min
([date]) and max([date]) in a query that is grouped. My
problem occurs because a person can be in one place a
couple of days, then somewhere else and then back to the
original place.

eg
Monday 8 Nov Brighton
Tuesday 9 Nov Brighton
Wednesday 10 Nov Eastbourne
Thursday 11 Nov Brighton
Friday 12 Nov Brighton

I was hoping to get a report to show:

Brighton 8 Nov to 9 Nov
Eastbourne 10 Nov
Brighton 11 Nov to 12 Nov

unfortunately when using the group by it groups all the
Brighton stuff together so that my summarised itinerary
says:

Brighton 8 Nov to 12 Nov
Eastbourne 10 Nov

which doesn't really explain correctly where someone can
expect to be for their hotel bookings.

The actual details are a lot more involved than this and
can last for more than one week - but the above is the
general idea of my problem.

Can anyone suggest a way that I can group the similar
things together unless they are split by something - in
which case it would group them in smaller groups rather
than one large all encompassing group.

If you require any further info please feel free to ask.

thanks for any help you can offer.

Regards

John
 
Top