Hey guys,
I am basically trying to show different columns based on information in 1 of my tables.
So for example if the data = 1, then show these columns, if it equals 2, show these different columns, if it equals 3 show different ones again.
I have been trying to use the IIF() function to do it but haven't had any luck so far. This is the code i have been trying to use:
Note i have been making a gym database and i want it to be able to show different exercises based on the person's goals.
I am basically trying to show different columns based on information in 1 of my tables.
So for example if the data = 1, then show these columns, if it equals 2, show these different columns, if it equals 3 show different ones again.
I have been trying to use the IIF() function to do it but haven't had any luck so far. This is the code i have been trying to use:
Code:
SELECT IIF(membership.Goals="Lose Weight",
(table1.Cardio), IIF(membership.Goals="Get Fit", (table1.Cardio, table2.Muscle_building_exercises)),
(table2.Muscle_building_exercises)
FROM membership, table1, table2
WHERE membershp.membership_no=[membership number?]