A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Exclude afield when using 'Select *'



 
 
Thread Tools Display Modes
  #1  
Old February 20th, 2010, 07:18 PM posted to microsoft.public.access.queries
Steve S
external usenet poster
 
Posts: 162
Default Exclude afield when using 'Select *'

The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do want
appended?
--
Steve S
  #2  
Old February 20th, 2010, 07:52 PM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Exclude afield when using 'Select *'

Steve S wrote:

The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do want
appended?


No.

A couple of years ago I wrote a small utility VBA function that I can use
against a query or table and it will print to the debug window all of the
field names separated with commas. Comes in very handy when you don't want
to type out all those field names manually in SQL statements.

I sometimes have to work with legacy tables on our IBM box that have over
100 fields. Definitely worth the one time effort to set up.
  #3  
Old February 20th, 2010, 08:57 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Exclude afield when using 'Select *'

No. There is no alternative to listing the fields you want.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Steve S wrote:
The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do want
appended?

  #4  
Old February 20th, 2010, 09:01 PM posted to microsoft.public.access.queries
Steve S
external usenet poster
 
Posts: 162
Default Exclude afield when using 'Select *'

Thanks Rick,

Not the answer I wanted but is what I expected. good idea about the utility
but I only have to do this once in a while and using QBE grid in design view
to generate most of my SQL saves lots of time.
--
Steve S


"Rick Brandt" wrote:

Steve S wrote:

The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do want
appended?


No.

A couple of years ago I wrote a small utility VBA function that I can use
against a query or table and it will print to the debug window all of the
field names separated with commas. Comes in very handy when you don't want
to type out all those field names manually in SQL statements.

I sometimes have to work with legacy tables on our IBM box that have over
100 fields. Definitely worth the one time effort to set up.
.

  #5  
Old February 20th, 2010, 09:20 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Exclude afield when using 'Select *'

On Sat, 20 Feb 2010 11:18:01 -0800, Steve S
wrote:

The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do want
appended?


As Rick says, no; but there's a quick way to add all the fields.

1. Add the table to the query design window.
2. Click the first field so it's selected.
3. Hold the Shift key and the arrow down key to select all fields.
4. Drag to the grid.
--

John W. Vinson [MVP]
  #6  
Old February 21st, 2010, 05:36 AM posted to microsoft.public.access.queries
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Exclude afield when using 'Select *'

John W. Vinson wrote in
:

On Sat, 20 Feb 2010 11:18:01 -0800, Steve S
wrote:

The following appends all 15 fields but I want to exclude Fld3.

INSERT INTO Fees
SELECT Fees.*
FROM Fees
WHERE (((Fees.ContestID)=9));


Is there a way to do this without listing out all 14 fields I do
want appended?


As Rick says, no; but there's a quick way to add all the fields.

1. Add the table to the query design window.
2. Click the first field so it's selected.
3. Hold the Shift key and the arrow down key to select all fields.
4. Drag to the grid.


Or:

1. select the first field.
2. SHIFT-click the last field.
3. CTRL-click any field you want to exclude.
4. drag to the grid.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.