I have a database for tracking song usage. I have a list of songs in tblSongs, and then I record the history of those songs being played in tblHistory, joined by tblLinkHistory.
I'm trying to write a query that will give me all songs that were NOT played in the last quarter. I could just do that on the one table, but the main table contains songs that don't appear in the History table (because there are a lot of songs we haven't performed yet, or have no history on), so it seems I need to use a query utilizing the EXCEPT statement. I can't seem to get the syntax right.
I have a query that pulls all the songs from the last quarter from tblHistory, called qryHistory3Month:
So here's my starting point just to try to get the query to run, but I keep getting the error "Syntax Error in FROM clause"
Thanks!!
Matt
I'm trying to write a query that will give me all songs that were NOT played in the last quarter. I could just do that on the one table, but the main table contains songs that don't appear in the History table (because there are a lot of songs we haven't performed yet, or have no history on), so it seems I need to use a query utilizing the EXCEPT statement. I can't seem to get the syntax right.
I have a query that pulls all the songs from the last quarter from tblHistory, called qryHistory3Month:
Code:
SELECT tblSongs.SongID, tblLinkHistory.SongID, tblHistory.Date
FROM tblSongs INNER JOIN (tblHistory INNER JOIN tblLinkHistory ON tblHistory.EventID = tblLinkHistory.EventID) ON tblSongs.SongID = tblLinkHistory.SongID
WHERE (((tblHistory.Date)>=DateAdd("q",-1,Now())))
ORDER BY tblHistory.Date DESC;
So here's my starting point just to try to get the query to run, but I keep getting the error "Syntax Error in FROM clause"
Code:
SELECT tblSongs.SongID, tblSongs.Title
FROM tblSongs
EXCEPT
SELECT qryHistory3Month.SongID
FROM qryHistory3Month;
Thanks!!
Matt