Re: report order by problem

To discuss Oracle Forms & Reports related technical issues.
Post Reply
mfa786
Posts: 51
Joined: Thu Jun 01, 2006 4:37 am
Location: Pakistan

Re: report order by problem

Post by mfa786 »

sir
when i use this query

SELECT VOUMASTER.discription,cheqno,NVL(SUBSTR(VOUMASTER.cheqno,10,10),0) AS chqno,VOUMASTER.entdate,VOUDETAIL.vno,VOUDETAIL.accid,VOUDETAIL.debit,VOUDETAIL.credit,CHARTOFACC.title AS acc_title,PARTYTABLE.title AS PARTY,DEPARTMENT.title AS DEPT
FROM VOUDETAIL,VOUMASTER,CHARTOFACC ,PARTYTABLE,DEPARTMENTMFA DEPARTMENT WHERE
VOUMASTER.vno=VOUDETAIL.vno AND
VOUDETAIL.accid=CHARTOFACC.accid AND
VOUMASTER.partyid=PARTYTABLE.partyid(+) AND VOUDETAIL.deptid=DEPARTMENT.deptid(+)
AND SUBSTR(VOUMASTER.vno,1,2)='BP' AND NVL(SUBSTR(VOUMASTER.cheqno,10,10),0) >0
ORDER BY chqno ASC

then get rigth result
chqno date
11009201 04-JUL-05
11009201 04-JUL-05
11009236 01-JUL-05
11009236 01-JUL-05
11009236 01-JUL-05
11009237 01-JUL-05
11009237 01-JUL-05
11009238 01-JUL-05
11009238 01-JUL-05
11009239 01-JUL-05
11009239 01-JUL-05
11009240 01-JUL-05
11009240 01-JUL-05
11009243 19-JUL-05
11009243 19-JUL-05
11009243 19-JUL-05
11009247 01-JUL-05
11009247 01-JUL-05


but when this query use in report then system not give me right result
not sort on chqno give me result unorder such as
start from

11009236
11009237
11009238
11009239
11009231
11009206
11009246
11009250
11009255
11009256
11009235

sir my cheqno field is string i convert to number by using nvl(cheq,0)
this type of result
sir how i get right restul and give me idea how i set order by through use property
like as form order by property
please give me idea how i set order by by useing report order by property

thank
aamir
najm
Posts: 74
Joined: Wed Apr 05, 2006 8:04 am
Location: Pakistan

Post by najm »

Its very Easy to do in a report you have a groups fields in your data model see in which group the chqno is then select it and drag it on the top of the same group your problem is solved your report is now in order of chqno.

Thanks

Cheers
Kashif
Posts: 137
Joined: Wed Apr 26, 2006 5:57 am
Location: Pakistan
Contact:

Post by Kashif »

Use TO_NUMBER Function to Convert Varchar to Number
Like

TO_NUMBER(NVL(SUBSTR(VOUMASTER.cheqno,10,10),0)) AS chqno


and user Order by Clause in ur Report Query
Like

ORDER BY TO_NUMBER(NVL(SUBSTR(VOUMASTER.cheqno,10,10),0)) ASC

Inshallah Ur Problem will solved.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests