Can Access create new headings for me for all like data?

  • Thread starter Thread starter ManhattanRebel
  • Start date Start date
M

ManhattanRebel

How can I direct Access to create a new heading for all like data that is
currently in the same field?

For example, my data looks like this now:


A B C D E - This is the headings row.
a b c x z
a b c x y
a b c z x
a b c y z
a b c d e

I need it to look like this without having to sort, cut and paste. There is
too much data to sort, cut and paste. Note: in the sample below the x,y, and
z now have their own fields

A B C D E X Y Z -----This is
new heading row
a b c x z
a b c x y
a b c x z
a b c y z
a b c d e
 
Yes, Access can do that. Since your data is obviously fictitious, it's
pretty hard to give instructions on how to do it though.

You need to create a query and put calculated fields in it. To get
essentially what you've asked for, your query would look something like:

SELECT A, B, C, IIf([D] <> "d", Null, "d") AS NewD,
IIf([E] <> "e", Null, "e") AS NewE,
IIf([D] = "x" OR [E] = "x", "x", Null) AS X,
IIf([D] = "y" OR [E] = "y", "y", Null) AS Y,
IIf([D] = "z" OR [E] = "z", "z", Null) AS Z
FROM MyTable

The "essentially" part is due to the fact that you need to rename columns D
and E: leaving their names as the same as the columns would lead to a
circular reference, so isn't possible.
 

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

Similar Threads

Scrabble Value calculation for Welsh words 0
Excel-Auto Sort and Paste to new Column 1
Database 2
Sorting Characters 4
Can I do this query in one step? 13
Count field 4
Referencing 2
Parts for my new build 10

Back
Top