TastyWheat
Registered User.
- Local time
- , 19:02
- Joined
- Dec 14, 2005
- Messages
- 125
This is probably a really simple query but I'm out of practice on SQL. I have a set of reservations and I need to get each email and any associated reservation dates, but I need to cut out dates that fall on the same day of the year.
I've gotten my query to generate this so far:
So I almost have what I want but I still get non-unique rows which is really what I'm shooting for. Yes, I tried DISTINCTROW but it doesn't change the output at all.
Here's my query which gives me output similar to that above:
I've gotten my query to generate this so far:
Code:
Email | MonthDay
-------------------------------
jane_doe@hotmail.com | 07/07
jane_doe@hotmail.com | 11/04
[COLOR="Red"]john_doe@hotmail.com | 01/22
john_doe@hotmail.com | 01/22[/COLOR]
So I almost have what I want but I still get non-unique rows which is really what I'm shooting for. Yes, I tried DISTINCTROW but it doesn't change the output at all.
Here's my query which gives me output similar to that above:
Code:
SELECT DISTINCTROW TBL1.Email, TBL1.MonthDay
FROM (
SELECT Reservation.Email, Format([When],"mm/dd") AS MonthDay
FROM Reservation
INNER JOIN [Time]
ON Reservation.RID = Time.ReservationID
WHERE (Reservation.Email Is Not Null)
) AS TBL1;