Can it be implemented with Query?

neoklis

Registered User.
Local time
Tomorrow, 01:15
Joined
Mar 12, 2007
Messages
80
I am dealing a new problem and I don’t know if this can be accomplished with query.

I have a table like

Date b c d
1/01/01 145 202 15
1/01/01 45 78 65

And I want an output like

Date f1 f2
1/01/01 b 145
1/01/01 b 45
1/01/01 c 202
1/01/01 c 78
1/01/01 d 15
1/01/01 d 65

I thought about crosstab query but I finally realize that it may be not affective. Any thoughts..;
 
You'll need to use a union for each column b,c,d.

Code:
Select [DATE], "B" AS F1, B AS F2
FROM [YOURTABLE]
UNION ALL
SELECT [DATE], "C" AS F1, C AS F2
FROM [YOURTABLE]
UNION ALL
SELECT [DATE], "D" AS F1, D AS F2
FROM [YOURTABLE]
 
Thanks a lot!! It was really nice..!
 

Users who are viewing this thread

Back
Top Bottom