Runawaygeek
Registered User.
- Local time
- Today, 18:58
- Joined
- Mar 28, 2016
- Messages
- 77
Hi ,
In MYSQL, i can use the CASE statement to take 1 column from a table and generate 2 new columns with new data based on that info.
Eg. TBL1.Bike
BIKE
Yammaha R1
Kawasaki H2
Suzuki GSX
Honda FireBlade
I can then CASE this info, with something like
So how can i do this in SQL with in Access?
Someone mentioned SWITCH, but i cant see how i get SWITCH into the SQL query and then how i name a new column to contain that data under the INSERT TABLE???
Help!
:banghead:
In MYSQL, i can use the CASE statement to take 1 column from a table and generate 2 new columns with new data based on that info.
Eg. TBL1.Bike
BIKE
Yammaha R1
Kawasaki H2
Suzuki GSX
Honda FireBlade
I can then CASE this info, with something like
Code:
Select Name
, CASE BIKE
WHEN 'Yammaha R1' THEN 'SUPER SPORTS'
WHEN 'Kawasaki H2' THEN 'CRAZY FAST'
ELSE 'Boring'
END AS SPEED_TYPE
, CASE BIKE
WHEN 'Yammaha R1' THEN 'Bridestone'
WHEN 'Kawasaki H2' THEN 'Conti'
ELSE 'Michers'
END AS RUBBER
FROM etc..
So how can i do this in SQL with in Access?
Someone mentioned SWITCH, but i cant see how i get SWITCH into the SQL query and then how i name a new column to contain that data under the INSERT TABLE???
Help!
:banghead: