learning_grexcel
Active Member
- Joined
- Jan 29, 2011
- Messages
- 319
I wrote the following code but I get error something similar to "order by clause conflict with group"
In this example, saletype column has three values as "blue, red, yellow" but I want to display in the following order : yellow, red, blue.
Code:
transfer sum(quantity) as [sum of quantity]
select sum(quantity) as Total, saletype from table
group by saletype
order by iif(saletype='yellow',1,iif(saletype='red',2,iif(saletype='blue',3)))
In this example, saletype column has three values as "blue, red, yellow" but I want to display in the following order : yellow, red, blue.