Doozer1979
Registered User.
- Local time
- Today, 20:57
- Joined
- Jul 4, 2007
- Messages
- 32
Hello,
I have a list of items that need to be checked on a daily basis. At the end of the day i need to print off a report of all the items that have not been checked that day.
The way that i am attempting to do this is by using a nested SQL NOT IN query but i can't get it to work.
The code that i am using is below.
SELECT Stations.StationName, Stations.StationID, Group.GroupID, Group.GroupName
FROM [Group] INNER JOIN Stations ON Group.GroupID = Stations.GroupID
WHERE (((Stations.StationID) Not In (Select AlertsAM.AlertAMID, Stations.StationID
FROM [group] INNER JOIN Stations ON AlertsAM.StationID = Stations.StationID
WHERE (((AlertsAM.DateOfAction)=[Forms]![frmReports]![txtUncheckedStations])))));
The parameter at the end of the SQL Statement is a text field that the user enters the dtate for the report that they wish to print out.
If its helps explain the code, each station belongs to a group of stations
Does anyone know if i'm on the right track with this?
Many thanks
I have a list of items that need to be checked on a daily basis. At the end of the day i need to print off a report of all the items that have not been checked that day.
The way that i am attempting to do this is by using a nested SQL NOT IN query but i can't get it to work.
The code that i am using is below.
SELECT Stations.StationName, Stations.StationID, Group.GroupID, Group.GroupName
FROM [Group] INNER JOIN Stations ON Group.GroupID = Stations.GroupID
WHERE (((Stations.StationID) Not In (Select AlertsAM.AlertAMID, Stations.StationID
FROM [group] INNER JOIN Stations ON AlertsAM.StationID = Stations.StationID
WHERE (((AlertsAM.DateOfAction)=[Forms]![frmReports]![txtUncheckedStations])))));
The parameter at the end of the SQL Statement is a text field that the user enters the dtate for the report that they wish to print out.
If its helps explain the code, each station belongs to a group of stations
Does anyone know if i'm on the right track with this?
Many thanks