Complex query

Ben Saeed

Registered User.
Local time
Today, 22:14
Joined
Mar 8, 2013
Messages
14
Hello...

I need help with regard to making query

I have a table which field followup hereunder.

Name | Registration date | Category
Test | 01.03.13 |1
Test1 | 02.03.13 |2
Test2 | 02.03.13 |2
Test3 | 02.03.13 |1

i wanted retrieve data as follow. Please let me know if there is any possibility (without crosstab query)

Name | Registration date |[Category] as program|[Category] as training
Test | 01.03.13 | 1 |
Test1 | 02.03.13 | | 2
Test2 | 02.03.13 | | 2
Test3 | 02.03.13 | 1 |

Looking forward to your usual help
Regards,

Ben
 
Using IIF should do the trick if you have a limited number of known options
Code:
Select YourName, 
Your Date, 
iif(YourCategory=1,1,null) AS YourProduct, 
iif(YourCategory=2,2,null) AS YourTraining 
FROM YourTable
 

Users who are viewing this thread

Back
Top Bottom