Not sure I followed you, Steven.
Your final query asks for the records WHERE
((tblJobs.Status <> 'Canceled') OR (tblJobs.Status <>'Completed'))
Only one part of an OR has to match to return the record.
The records where Status is Canceled match the first part.
The records where Status is Completed match the second part.
Hence all the Canceled and all the Completed get returned.
Is that what you intended?
On a different topic, you have tblJobs is on the outside of the join?
The criteria you applied have the effect of eliminiating nulls.
Hence the query will behave like an inner join.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Steven Sutton" <(E-Mail Removed)> wrote in message
news:BDFE8E6B-B8EF-4BFC-B324-(E-Mail Removed)...
> The problem I am having is with an SQL statement I wrote in VBA but the
> examples I am giving actually come from a Query where I could let Access
> write the SQL statement for me.
>
> I have a table that has 1143 records in it. If I run the following Query
> it
> returns 11 records, which is correct:
>
> SELECT tblJobTickets.JobNumber, tblJobs.intJobID, tblJobs.txtJobName,
> tblJobs.Status, tblJobs.dtEntered, tblJobs.dtModified,
> tblJobs.txtUsername,
> tblJobs.intStatusSort
> FROM tblJobTickets RIGHT JOIN tblJobs ON tblJobTickets.intJobID =
> tblJobs.intJobID
> WHERE ((tblJobs.Status)<>'Completed');
>
> If I run this Query, it returns 1142 records - also correct (at this time,
> there is only one record with the Status of 'Canceled':
>
> SELECT tblJobTickets.JobNumber, tblJobs.intJobID, tblJobs.txtJobName,
> tblJobs.Status, tblJobs.dtEntered, tblJobs.dtModified,
> tblJobs.txtUsername,
> tblJobs.intStatusSort
> FROM tblJobTickets RIGHT JOIN tblJobs ON tblJobTickets.intJobID =
> tblJobs.intJobID
> WHERE ((tblJobs.Status)<>'Canceled');
>
> But if I run this Query, I get all 1143 records and it seems to me that I
> should be getting 10 - the 11 that aren't 'Completed' minus the one that
> is
> 'Canceled':
>
> SELECT tblJobTickets.JobNumber, tblJobs.intJobID, tblJobs.txtJobName,
> tblJobs.Status, tblJobs.dtEntered, tblJobs.dtModified,
> tblJobs.txtUsername,
> tblJobs.intStatusSort
> FROM tblJobTickets RIGHT JOIN tblJobs ON tblJobTickets.intJobID =
> tblJobs.intJobID
> WHERE (((tblJobs.Status)<>'Canceled')) OR
> (((tblJobs.Status)<>'Completed'));
>
> Does anyone see why I am not getting the results I am expecting? If I
> haven't made it clear, what I am wanting is to exclude all records whose
> Status is either 'Completed' or 'Canceled' but instead I am getting all
> records. Any suggestions? Thanks again to all who help.