Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting

Status
Not open for further replies.

musini

Technical User
Jan 19, 2008
75
US
Hi All,

I have a field in the report where the data is as below.

JAN 2007
FEB 2007..
.. May 2008

I am grouping on this field and after grouping I am getting it as below.

APR 2007
APR 2008
AUG 2007
AUG 2008
DEC 2007....

It is sorting by alphabetical order but what I need is ascednig order month wise and then year wise.

Please help me with this.

Thanks,
M
 
You can create formula on that field one as month(yourdate field). And next formula as year(yourfield).In record sort expert insert these or else you can do grouping.
 
from the database what I am getting is string field and I could not use month or year on that field.
 
then create 2 formula formula 1
left(yourfield, 3) gives you apr jun etc. and second formula
left(strreverse(strreverse(yourfield)),4). whih gives you 2007 2008 etc.Similarly do sorting.
 
You could create a formula {@month} like this:

select left({table.field},3)
case "JAN" : 1
Case "FEB" : 2
case "MAR" : 3 //etc

Create a second formula {@year}:

right({table.field},4)

Insert a group#1 on {@year} and then a Group#2 on {@Month}. Then place your actual field in the group#2 header and suppress the group #1 header.

-LB
 
Thanks, It worked perfect.

Regards,
M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top