Subject Re: Sorting detail listing under a Group
From William McGuffey <wareaglewsm@gmail.com>
Date Thu, 11 Jul 2019 09:34:17 -0400
Newsgroups dbase.getting-started

Mervyn Bick Wrote:

> On 2019-07-10 8:35 PM, William McGuffey wrote:
> > Just started using the Report feature in Dbase 12.  How do I sort a listing of data under a Group alphabetically?    Example:
> >
> >                  Group      =  Boys
> >                  Detail list  =     John
> >                                         Bill
> >                                         Adam
>
> Your rowset must always be ordered on the field used in a group's
> groupBy property.  There is, however, nothing to stop you from adding
> more fields to the order by clause to arrange the data within the group.
>
> Assuming your fieldnames are gender for the group's groupBy property and
> you have last_name and first_name for text objects on the detailband
> then in your query
>
> oRef.sql = 'select * from whatever order by gender,last_name,first_name'
>
> This will give you the boy's names ordered by surname.  If you want the
> names ordered by first_name then
>
> oRef.sql = 'select * from whatever order by gender,first_name,last_name'
>
> Mervyn.
>
>