I need to show all records, but use the distinct function on only one field. I have been searching around and I have seen on some sites that there is a SELECT DISTINCT ON function, but this doesn't seem to work with access. This is for a football schedule database I have been working on. The way the data comes in is by school schedule. Most games "location" is either 'HOME' or 'AWAY' so I can eliminate all duplicates on about 95% by selecting "...where location <> 'AWAY'" but there are few cases where the "location" is a neutral location, therefore I can't filter that out.
The following are my fields:
Date Scheduled, TeamName, Opponent, Location, Win/Loss, Score
Select Distinct doesn't work because it will still show both records. for example:
Date Scheduled|TeamName|Opponent|Location|Win/Loss|Score
9/2/2006|Bowling Green|Wisconsin|Cleveland, OH|null|0-0
9/2/2006|Wisconsin|Bowling Green|Cleveland, OH|null|0-0
In this case it doesn't matter what record is displayed, I just need one of them to show up.
Make sense?
Here is what I currently have. This will display everything correct except it shows the one game scheduled at the neutral location twice as seen above.
SELECT Schedule.[Date Scheduled], Schools.TeamName, Schedule.Opponent, Schedule.Location, Schedule.[Win/Loss], Schedule.Score
FROM Schedule, Schools
WHERE ((([Schedule]![Date Scheduled])>#8/27/2006# And ([Schedule]![Date Scheduled])<#9/4/2006#) AND (([Schedule]![Location])<>'AWAY'))
ORDER BY Schedule.[Date Scheduled];
thanks
The following are my fields:
Date Scheduled, TeamName, Opponent, Location, Win/Loss, Score
Select Distinct doesn't work because it will still show both records. for example:
Date Scheduled|TeamName|Opponent|Location|Win/Loss|Score
9/2/2006|Bowling Green|Wisconsin|Cleveland, OH|null|0-0
9/2/2006|Wisconsin|Bowling Green|Cleveland, OH|null|0-0
In this case it doesn't matter what record is displayed, I just need one of them to show up.
Make sense?
Here is what I currently have. This will display everything correct except it shows the one game scheduled at the neutral location twice as seen above.
SELECT Schedule.[Date Scheduled], Schools.TeamName, Schedule.Opponent, Schedule.Location, Schedule.[Win/Loss], Schedule.Score
FROM Schedule, Schools
WHERE ((([Schedule]![Date Scheduled])>#8/27/2006# And ([Schedule]![Date Scheduled])<#9/4/2006#) AND (([Schedule]![Location])<>'AWAY'))
ORDER BY Schedule.[Date Scheduled];
thanks