Ordering Query Groups

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Ewanm
Posts: 111
Joined: Mon Jun 04, 2007 11:09 am
Location: Scotland

Ordering Query Groups

Post by Ewanm »

I am trying to order the Groups used in a query.

I have a Query that selects all entries from a BO. I then use the Grouping function to group the entries into groups made from a field called Period which contains a calculated value eg " July 2019". there is also another attribute which contains a number for the month "7". I then want to order the displayed groups in year and month order. Ordering within the groups is easy but I cannot figure out how to order the actual groups . eg I have record that have Period Jan 2019, Feb 2019, April 2019, July 2019, July 2019 etc
The groups when displayed show as:

April 2019
Feb 2019
Jan 2019
July 2019
June 2018

I want to order them as

June 2018
Jan 2019
Feb 2019
April 2019
July 2019


Is this possible by using groups or do I need to do something else?
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Ordering Query Groups

Post by idpSteve »

You can change the order of groups by adding:

FIND ...... ORDER BY [Group Attribute] ASC, [Attribute to sort within group] ASC

It looks like your groups are sorted alphabetically, that's probably the issue.

I think you need to change the calculated attribute type to 'Date', that should resolve your issue. (see image)
Attachments
CalcType.PNG
CalcType.PNG (3.19 KiB) Viewed 3367 times
Post Reply