Pass through query giving an invalid column error

G

Guest

I am trying to write a pass through query using Access 2000. My source table
has a field that has three blank spaces as a place holder. I do not want or
need records that have three blanks in this field as well as records numbered
840. I am trying to write an SQL statement that will eliminate those records
from my query. I am using the following code:

select
.[field]
from

WHERE ((Not (
.[field] )= "840" or Not (
.[field] )=" "));

I get an error at line 3 invalid column name '840' and ' '. I can remove
the quotes for the 840 and it runs and exlcudes records that are 840. Quotes
or no quotes I cannot get it to remove the three spaces fields. Any ideas?
Thanks in advance for your help.
 
J

John Spencer

If it is a pass-through query, you should probably be using single quotes
for the text.

SELECT FIELD
FROM TABLE
WHERE Field <> 840 and Field <> ' '

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top