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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Stacking Columns



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 02:42 PM posted to microsoft.public.access
Gunti
external usenet poster
 
Posts: 88
Default Stacking Columns

Hi,

I've got the following problem.

I've got a table with multiple columns next to eachother, as in:

5000 | AL | AP | AQ | AL | AP

Basicly i want to create a query where it stacks all those columns
(AL,AP,AQ,AL,AP) on top of eachother in one column. This so i can use this
column with a 'total' to get rid of the doubles, then process this column
further.

How would i get this done?

Thanks for helping,
Gunti
  #2  
Old May 12th, 2010, 03:52 PM posted to microsoft.public.access
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Stacking Columns

By "columns", do you mean fields or field names? What do you mean by "stack"?

A WAG suggests you want to normalize your table with a union query but I
could be very wrong. Can you provide table and field names as well as a
couple sample records and desired display in your query?

--
Duane Hookom
Microsoft Access MVP


"Gunti" wrote:

Hi,

I've got the following problem.

I've got a table with multiple columns next to eachother, as in:

5000 | AL | AP | AQ | AL | AP

Basicly i want to create a query where it stacks all those columns
(AL,AP,AQ,AL,AP) on top of eachother in one column. This so i can use this
column with a 'total' to get rid of the doubles, then process this column
further.

How would i get this done?

Thanks for helping,
Gunti

  #3  
Old May 20th, 2010, 01:51 PM posted to microsoft.public.access
Gunti
external usenet poster
 
Posts: 88
Default Stacking Columns

I basicly have the following 'record' in access:

Field 1, Field 2, Field 3, Field 4, Field 5
AS AS AF AG AF
Multiple records

I want Access to return the following in a query:

Record 1 AS
Record 2 AS
Record 3 AF
Record 4 AG
Record 5 AF

Then i want Access to automaticly filter the duplicates which would return in:

Record 1 AS
Record 2 AF
Record 3 AG

Thanks for your time,
Gunti

"Duane Hookom" wrote:

By "columns", do you mean fields or field names? What do you mean by "stack"?

A WAG suggests you want to normalize your table with a union query but I
could be very wrong. Can you provide table and field names as well as a
couple sample records and desired display in your query?

--
Duane Hookom
Microsoft Access MVP


"Gunti" wrote:

Hi,

I've got the following problem.

I've got a table with multiple columns next to eachother, as in:

5000 | AL | AP | AQ | AL | AP

Basicly i want to create a query where it stacks all those columns
(AL,AP,AQ,AL,AP) on top of eachother in one column. This so i can use this
column with a 'total' to get rid of the doubles, then process this column
further.

How would i get this done?

Thanks for helping,
Gunti

  #4  
Old May 20th, 2010, 02:37 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Stacking Columns

Use a UNION query.

SELECT Field1
FROM SomeTable
UNION
SELECT Field2
FROM SomeTable
UNION
SELECT Field3
FROM SomeTable
UNION
SELECT Field4
FROM SomeTable
UNION
SELECT Field5
FROM SomeTable

That will return all the unique values in the fields. UNION queries can only
be built in SQL view and not in the Query design view (the GUI tool).

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

Gunti wrote:
I basicly have the following 'record' in access:

Field 1, Field 2, Field 3, Field 4, Field 5
AS AS AF AG AF
Multiple records

I want Access to return the following in a query:

Record 1 AS
Record 2 AS
Record 3 AF
Record 4 AG
Record 5 AF

Then i want Access to automaticly filter the duplicates which would return in:

Record 1 AS
Record 2 AF
Record 3 AG

Thanks for your time,
Gunti

"Duane Hookom" wrote:

By "columns", do you mean fields or field names? What do you mean by "stack"?

A WAG suggests you want to normalize your table with a union query but I
could be very wrong. Can you provide table and field names as well as a
couple sample records and desired display in your query?

--
Duane Hookom
Microsoft Access MVP


"Gunti" wrote:

Hi,

I've got the following problem.

I've got a table with multiple columns next to eachother, as in:

5000 | AL | AP | AQ | AL | AP

Basicly i want to create a query where it stacks all those columns
(AL,AP,AQ,AL,AP) on top of eachother in one column. This so i can use this
column with a 'total' to get rid of the doubles, then process this column
further.

How would i get this done?

Thanks for helping,
Gunti

  #5  
Old May 21st, 2010, 10:51 AM posted to microsoft.public.access
Gunti
external usenet poster
 
Posts: 88
Default Stacking Columns

Thanks alot, you can't believe how much you've helped me

Gunti

"John Spencer" wrote:

Use a UNION query.

SELECT Field1
FROM SomeTable
UNION
SELECT Field2
FROM SomeTable
UNION
SELECT Field3
FROM SomeTable
UNION
SELECT Field4
FROM SomeTable
UNION
SELECT Field5
FROM SomeTable

That will return all the unique values in the fields. UNION queries can only
be built in SQL view and not in the Query design view (the GUI tool).

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

Gunti wrote:
I basicly have the following 'record' in access:

Field 1, Field 2, Field 3, Field 4, Field 5
AS AS AF AG AF
Multiple records

I want Access to return the following in a query:

Record 1 AS
Record 2 AS
Record 3 AF
Record 4 AG
Record 5 AF

Then i want Access to automaticly filter the duplicates which would return in:

Record 1 AS
Record 2 AF
Record 3 AG

Thanks for your time,
Gunti

"Duane Hookom" wrote:

By "columns", do you mean fields or field names? What do you mean by "stack"?

A WAG suggests you want to normalize your table with a union query but I
could be very wrong. Can you provide table and field names as well as a
couple sample records and desired display in your query?

--
Duane Hookom
Microsoft Access MVP


"Gunti" wrote:

Hi,

I've got the following problem.

I've got a table with multiple columns next to eachother, as in:

5000 | AL | AP | AQ | AL | AP

Basicly i want to create a query where it stacks all those columns
(AL,AP,AQ,AL,AP) on top of eachother in one column. This so i can use this
column with a 'total' to get rid of the doubles, then process this column
further.

How would i get this done?

Thanks for helping,
Gunti

.

 




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 08:03 AM.


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