Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL query - excluding specified records

Status
Not open for further replies.

mattygriff

Programmer
May 14, 2001
350
GB
I am in the process of writing a team selection system for a local sports team and need help with a SQL query. In my database I have a table of fixtures and a table of results with the FixtureID field being common to both. I want to offer the adminuser the option of entering results for any fixtures which have already taken place but have not yet had their result entered. What I need is to retrieve all records from the FIXTURES table with a fixture date equalling or prior to the current date but only if the FixtureID does NOT appear in the RESULTS table. I think I need to use a SQL statement something like NOT IN but I have no idea how to formulate the SQL query.

Can anyone help ????
 
I think this might at least get you going in the right direction

SELECT *
FROM RESULTS INNER JOIN FIXTURES ON RESULTS.FixtureID =
FIXTURES.FixtureID
WHERE FixtureDate <=Date();

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top