Posted by: Nepalover September 15, 2006
Login in to Rate this Post:
0
?
One more question, when I use the SQL query:
SELECT Fruit, Num, IIf([Fruit]='Apple',Num*3) AS AppleSlice, IIf([Fruit]='Orange',Num/2) AS OrangeSlice, IIf([Fruit]='Banana',Num+3) AS BananaSlice
FROM Table1;
The calculated column are different where the results are stored, if I try to use the following query, it tells me the duplicate field.
SELECT Fruit, Num, IIf([Fruit]='Apple',Num*3) AS Fruitsqty, IIf([Fruit]='Orange',Num/2) AS Fruitsqty, IIf([Fruit]='Banana',Num+3) AS Fruitsqty
FROM Table1;
I need to put all of the calculated numbers in one column, it it possible using the CASE WHEN query? I tried it but I'm getting the syntax errors....