I have an Access 2007 table called Master which contains, among many many others, the following columns:
Master.UID,
Master.[Team Comments],
Master.[Judy Comments],
Master.[Sue Comments],
Master.[Paul Comments],
Master.[CSE Comments],
Master.[CSE Name],
Master.[Sue Comments1],
Master.[David Comments]
I would like to create a new table called Comments which looks like this:
CommentID
UID
Name
Comment
There are several issues here:
- There are two Sue comment columns; these should not be concatenated, but a seperate row put in for each entry.
- With one exception, the value of the Name column is in the name of the Master column
- The exception is the CSE comment and CSE name
- The UID is the foreign key to the Master table
- Skip any blank comment fields, of which there are many.
As you can see, I’m trying to apply just a touch of normalization to one craaaaaazy big table.
TIA!
This is apparently a one-time action, so there is no need to do this in one single query.
This means that it’s actually very easy, because you can build a separate query for each value and just execute one after another.
The basic pattern looks like this (for the
Team Commentscolumn).(Note that I assume that the
CommentIDis an auto value field, so I don’t have to deal with it at all)For the two
Sue Commentscolumns, you just execute two similar queries in a row:And for the “CSE” columns…I understood that the
Namefor theCSE Commentscolumn is not fixed as in the other examples, but it should be taken from theCSE Namecolumn instead.Correct? If yes, then the query would need to look like this: