|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Combining multiple fields from one table
Hi,
I need to combine 10 fields into 2 fields. example: Original table Date#1 Trainer#1 Date#2 Trainer#2 Date#3 Trainer#3 Date#4 Trainer#4 Date#5 Trainer#5 Course new table Date Trainer Course Thanks |
|
#2
|
||||
|
||||
|
So you want the data to look like this correct?
new table Date Trainer Course Date#1 Trainer#1 Course Date#2 Trainer#2 Course Date#3 Trainer#3 Course Date#4 Trainer#4 Course Date#5 Trainer#5 Course If this isn't what the final should be, can you give an example of what the final should be? Is this a one time thing or do you need to do it regularly? |
|
#3
|
|||
|
|||
|
Yes, that example looks good. Unfortunately, it will not be a one time thing.
|
|
#4
|
||||
|
||||
|
Sorry about the slow reply.
OK the next question is do you always have new data or do you need seperate the data that has already been converted from the new data? To insert the fields into a new table: INSERT INTO newTable (Course_Date, Trainer, Course) (SELECT Date1, Trainer1, Course FROM origTable UNION SELECT Date2, Trainer2, Course FROM origTable WHERE Date2 Is Not NULL UNION SELECT Date3, Trainer3, Course FROM origTable WHERE Date3 Is Not NULL ... UNION SELECT Date8, Trainer8, Course FROM origTable WHERE Date8 Is Not NULL); |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Combining multiple fields from one table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|