Access 97 query not Working

  • Thread starter Thread starter Jeff Rush
  • Start date Start date
J

Jeff Rush

I tried this and when I hard code the names as you noted in the second
example it work flawlessly.

However, I tried to modify your wonderful code to make things a little more
manageable and modified it to:

SELECT tblSurvey.Name, tblSurvey.Source, tblSurvey.REFER_TO,
tblSurvey.ACTIVITY_NUM, tblSurvey.shuffle
FROM tblSurvey
WHERE tblSurvey.[Name] Not In (HelpDeskPPL.[HlpDskName]);

So I could simply administer the list of people from the HelpDeskPPL table.

However when I do this I get an Enter Parameter window. Do I need an *
somewhere in the NOT IN statement??

Thank You!

Jeff
 
I believe you need to add HelpDeskPPL after tblSurvey in your SQL statement
and add HelpDeskPPL.HlpDskName to the Select part.

SELECT tblSurvey.Name, tblSurvey.Source, tblSurvey.REFER_TO,
tblSurvey.ACTIVITY_NUM, tblSurvey.shuffle, HelpDeskPPL.HlpDskName
FROM tblSurvey, HelpDeskPPL
WHERE tblSurvey.[Name] Not In (HelpDeskPPL.[HlpDskName]);



Jeff Rush said:
I tried this and when I hard code the names as you noted in the second
example it work flawlessly.

However, I tried to modify your wonderful code to make things a little more
manageable and modified it to:

SELECT tblSurvey.Name, tblSurvey.Source, tblSurvey.REFER_TO,
tblSurvey.ACTIVITY_NUM, tblSurvey.shuffle
FROM tblSurvey
WHERE tblSurvey.[Name] Not In (HelpDeskPPL.[HlpDskName]);

So I could simply administer the list of people from the HelpDeskPPL table.

However when I do this I get an Enter Parameter window. Do I need an *
somewhere in the NOT IN statement??

Thank You!

Jeff

(Just to give a hard time, Gary <g>)

... and I bet that Jeff will now get all "Ryan", "Brian", "Russell",
"Fredrick" and "Todd".

Remember the multiplicative rule in applying NOT to a compound expression,
you need to convert OR to AND and AND to OR.

Try:
...
WHERE tblSurvey.[Name] <> "Ryan"
AND tblSurvey.[Name] <> "Brian"
AND tblSurvey.[Name] <> "Russell"
AND tblSurvey.[Name] <> "Fredrick"
AND tblSurvey.[Name] <> "Todd"

I think it is clearer and shorter to use:

.... WHERE tblSurvey.[Name]
Not In ("Ryan", "Brian", "Russell", "Fredrick", "Todd")

I assumed the spelling of "Fredrick" was incorrect in the original post.
 
Back
Top