G
Guest
First let me say thanks to all the MVPs out there. Reading through the
various postings in these newsgroups has been an invaluable education!
Here's an interesting one.
1) Having to select the Min and Max Date Range on Hotel Registrations. I
was going to start just with the Min so I ran the following SQL. Without the
grouping, a quick scan of 30 records shows only two dates, 4/4/05 and 4/5/05.
When I group and choose Min on the CheckIn field, the result is 4/12/05. I
verified the data in the table to make sure I wasn't missing something - all
that is there is 4/4/05 and 4/5/05. Where is 4/12/05 coming from?
2) My CheckOut dates range from 4/8/05 to 4/10/05. The Max function
properly gives me 4/10/05 on the grouping. Assuming I figure out the problem
to #1 above, can I run BOTH the Min and Max functions at the same time to
give me 4/4/05 and 4/10/05, respectively?
SELECT EventsRegs.EventID, Min(EventsRegsHotels.CheckIn) AS MinOfCheckIn
FROM EventsRegs INNER JOIN EventsRegsHotels ON EventsRegs.EventRegID =
EventsRegsHotels.RegID
GROUP BY EventsRegs.EventID
HAVING (((EventsRegs.EventID)=157));
Thanks!
various postings in these newsgroups has been an invaluable education!
Here's an interesting one.
1) Having to select the Min and Max Date Range on Hotel Registrations. I
was going to start just with the Min so I ran the following SQL. Without the
grouping, a quick scan of 30 records shows only two dates, 4/4/05 and 4/5/05.
When I group and choose Min on the CheckIn field, the result is 4/12/05. I
verified the data in the table to make sure I wasn't missing something - all
that is there is 4/4/05 and 4/5/05. Where is 4/12/05 coming from?
2) My CheckOut dates range from 4/8/05 to 4/10/05. The Max function
properly gives me 4/10/05 on the grouping. Assuming I figure out the problem
to #1 above, can I run BOTH the Min and Max functions at the same time to
give me 4/4/05 and 4/10/05, respectively?
SELECT EventsRegs.EventID, Min(EventsRegsHotels.CheckIn) AS MinOfCheckIn
FROM EventsRegs INNER JOIN EventsRegsHotels ON EventsRegs.EventRegID =
EventsRegsHotels.RegID
GROUP BY EventsRegs.EventID
HAVING (((EventsRegs.EventID)=157));
Thanks!