Home » Developer & Programmer » Reports & Discoverer » Sorting Data in Reports
icon3.gif  Sorting Data in Reports [message #249397] Wed, 04 July 2007 05:19 Go to next message
Arun1203
Messages: 78
Registered: September 2006
Location: Gaborone,Botswana
Member

Dear Members,

I have report in which Iam grouping the data by a field known as "MONTH".

Iam picking the value of MONTH as follows:

to_char(Intimation_Date,'MON')

Here Intimation_Date is a column in the table which stores the date.
From this date Iam picking the value of month.

For Example if the Intimation_Date =12-Jun-2007 then MONTH will have the value "JUN".

And now Iam sorting the data month wise by grouping left based on the value of MONTH.

But my output is getting sorted based on the alphabetic order.
But I want it to sort month wise.

In brief my data is sorted like April,August,Feb,etc..

But I want it to sort by month order like Jan,Feb,Mar etc,,

Can any one let me know how to acheive this?

Best Regards & Thanks Cool
Re: Sorting Data in Reports [message #249414 is a reply to message #249397] Wed, 04 July 2007 07:05 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
one thing you can do is that a add a column, store values 1 for jan, 2 for feb, 3 for mar and more and sort the data according to that. Then I hope you can able to do that.

Ashu
Re: Sorting Data in Reports [message #249681 is a reply to message #249414] Thu, 05 July 2007 09:45 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
Sort on to_char(Intimation_Date,'MM') instead.
Re: Sorting Data in Reports [message #250181 is a reply to message #249397] Mon, 09 July 2007 00:50 Go to previous messageGo to next message
smruti
Messages: 1
Registered: July 2007
Junior Member

hi,

just select this clause in the select statement and give it an alias like

to_char(Intimation_Date,'MON') intimatedate

then

after group by put an -> order by "intimatedate"


try it out...it will work...
Re: Sorting Data in Reports [message #250870 is a reply to message #249397] Wed, 11 July 2007 12:09 Go to previous message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
smruti wrote on Mon, 09 July 2007 01:20
it will work...


No dear, it will not work. You're converting a date to a varchar2, so sorting will be done alphabetically.
Previous Topic: Oracle Reports 6i
Next Topic: Discoverer Item class ld display meaning but return ID
Goto Forum:
  


Current Time: Mon Dec 05 13:20:20 CST 2016

Total time taken to generate the page: 0.20267 seconds