Sunday, January 30, 2011

The importance of order

Today I`ve found out how important is the order in order (by).
In Crystal reports you can create groups and give them order of display.
The order can be Asc, Desc, Specified order (pre determined) or in original order.
From some reason the original order didn`t work as I wanted, it kept giving me mixed up results.
After a lot of testings I`ve come to realize that in order to keep the group together, the order of the order by in SQL query is important.
The first column in the order by must be the one you`re grouping by.
And if you`re making group inside a group, the second column and so on in the order by query must match your groupings.

Shahar

No comments:

Post a Comment