Query always pulls ALL fields from tables

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

Guest

Until recently (2-3 months ago) I never noticed this problem, but now when I
make a query it pulls ALL the fields from all tables in the query.

An example: I ask for a listing sorted by Last Name, First Name. Two
fields only.
The query generates a SQL that says:
SELECT Personnel.LastName, Personnel.FirstName, *
FROM Personnel
ORDER BY Personnel.LastName, Personnel.FirstName;

That comma and asterisk are the killers.

Does anyone know why Access would add this if I am not asking for it?
Anyway to prevent it from happening?

Thank You!
 
The problem is you ARE asking for it, that's what the * indicates. Simply
remove the , * and just have:

SELECT Personnel.LastName, Personnel.FirstName
FROM Personnel
ORDER BY Personnel.LastName, Personnel.FirstName;
 
Either in the specific query or under Tools, Options, Tables/Queries tab you
have Output All Fields selected.

That adds the * no matter how you create the query.
 
Hi,



The * is added if the query's property "Output All Fields" is set to yes.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top