Query Problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""
 
Thanks for a quick response, however I am receiving the following error
message :(

"You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)"

Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


Kathy said:
I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
Or, simpler,

Select * From Vendors Where Len(Trim([Post Codes] & "")) = 0


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


Kathy said:
I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
Hi, Kathy
Can you post the SQL please

--
I hope that helped
Good luck


Kathy said:
Thanks for a quick response, however I am receiving the following error
message :(

"You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)"

Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


Kathy said:
I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
SELECT VENDORS.Vendno, VENDORS.Name, VENDORS.Postcode
FROM VENDORS;


Douglas J Steele said:
Or, simpler,

Select * From Vendors Where Len(Trim([Post Codes] & "")) = 0


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


Kathy said:
I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
I'm not sure if you received the SQL. Here it is

SELECT VENDORS.Vendno, VENDORS.Name, VENDORS.Postcode
FROM VENDORS;

thanks

Ofer said:
Hi, Kathy
Can you post the SQL please

--
I hope that helped
Good luck


Kathy said:
Thanks for a quick response, however I am receiving the following error
message :(

"You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)"

Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


:

I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
Thanks Douglas but I received the same error message again :(

Douglas J Steele said:
Or, simpler,

Select * From Vendors Where Len(Trim([Post Codes] & "")) = 0


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


Kathy said:
I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
SELECT VENDORS.Vendno, VENDORS.Name, VENDORS.Postcode
FROM VENDORS WHERE LEN(TRIM(VENDORS.Postcode & "")) = 0

although all you really should need is

SELECT Vendno, Name
FROM VENDORS WHERE LEN(TRIM(Postcode & "")) = 0

(no need to include Postcode in the SELECT part if you know it doesn't
exist!)

Both Ofer and I had [Post Codes]: do you have a table with that name?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kathy said:
SELECT VENDORS.Vendno, VENDORS.Name, VENDORS.Postcode
FROM VENDORS;


Douglas J Steele said:
Or, simpler,

Select * From Vendors Where Len(Trim([Post Codes] & "")) = 0


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ofer said:
Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


:

I am trying to run a query from a table (of vendors) where a column
of
Post
Codes has a blank field. The requirement is that we produce a report
to
show
which Vendor did not supply the Post Code. I have tried using
SELECT,
WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 
I can't see the where statement, also it sound like you creating a query
based on another query
Is that the case?
If so, does the first query runs with no errors

I need the full SQL with the where condition

--
I hope that helped
Good luck


Kathy said:
I'm not sure if you received the SQL. Here it is

SELECT VENDORS.Vendno, VENDORS.Name, VENDORS.Postcode
FROM VENDORS;

thanks

Ofer said:
Hi, Kathy
Can you post the SQL please

--
I hope that helped
Good luck


Kathy said:
Thanks for a quick response, however I am receiving the following error
message :(

"You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)"

:

Try this

Select * From Vendors Where [Post Codes] is null or Trim([Post Codes])=""

--
I hope that helped
Good luck


:

I am trying to run a query from a table (of vendors) where a column of Post
Codes has a blank field. The requirement is that we produce a report to show
which Vendor did not supply the Post Code. I have tried using SELECT, WHERE &
FROM using the IsNull function. Does anyone know where I might be going
wrong? Thanks
Kathy
 

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

Back
Top