I have an odd query I want to write.
Basically, I have 2 tables. One called activity where everytime a record is viewed it is added to the activity table. Another which is just a list of all the records in the database.
What I want is to find all records in the record table that do not appear in the activity table (i.e. the ones which have not been viewed). The records are distinguishable by the column record_id, which appears in both tables.
Can someone point me in the right direction to do this please?
At the moment I have:
$ActivityDatum = SQLGet("SELECT records.[record_id]
RIGHT JOIN records ON activity.record_id = records.[record_id]
WHERE date_accessed <= '" . $date_to . "' AND date_accessed >= '" . $date_from . "'");
But I just get a syntax error