Board index » cppbuilder » How do I sort records on a QuickReport obtained by using SQL functions

How do I sort records on a QuickReport obtained by using SQL functions


2005-12-20 03:04:42 PM
cppbuilder52
Hello!
I have a querry in which I obtain a recordset by SELECTing from various tables and using SQL FUNCTIONS such as SUM(Col1*Col2)
and GROUP BY Col3.
I am wondering how to sort i.e ORDER BY the result of SUM(Col1*Col2).
I wish to display the Recordset using a QuickReport sorted using the result of SUM(Col1*Col2).
Your help will be highly appreciated.
 
 

Re:How do I sort records on a QuickReport obtained by using SQL functions

"TheKariuki" < XXXX@XXXXX.COM >wrote:
Quote

Hello!

I have a querry in which I obtain a recordset by SELECTing from various tables and using SQL FUNCTIONS such as SUM(Col1*Col2)
and GROUP BY Col3.

I am wondering how to sort i.e ORDER BY the result of SUM(Col1*Col2).

I wish to display the Recordset using a QuickReport sorted using the result of SUM(Col1*Col2).

Your help will be highly appreciated.
Hi,
Use:
Order by 1 ( 1 = Numeral position of the desired SUM(...) )
HTH
Antonio
 

Re:How do I sort records on a QuickReport obtained by using SQL functions

Thanks so much Antonio.
You just made my day. Didn't know numbers would replace the column names. Thanks once again.
 

{smallsort}