If you are using the DADE query designer, inside the Tables tab, you can select the distinct checkbox at the lower right corner to only select distinct values. Then you can define your calculated field in the calcs tab and lastly sort by that calculated field using the sort tab. The resulting SQL will look something like the following...
SELECT DISTINCT orders.OrderNo, SUM(orders.AmountPaid) SUM_orders_AmountPaid FROM "orders.db" orders GROUP BY orders.OrderNo ORDER BY 2
Comments
If you are using the DADE query designer, inside the Tables tab, you can
select the distinct checkbox at the lower right corner to only select
distinct values. Then you can define your calculated field in the calcs tab
and lastly sort by that calculated field using the sort tab. The resulting
SQL will look something like the following...
SELECT DISTINCT orders.OrderNo,
SUM(orders.AmountPaid) SUM_orders_AmountPaid
FROM "orders.db" orders
GROUP BY orders.OrderNo
ORDER BY 2
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com