cannot sort varchar2 field as numeric in report builder 6i [message #247555] |
Tue, 26 June 2007 06:33 |
Abeer30
Messages: 110 Registered: March 2007
|
Senior Member |
|
|
Hello,
I am using report builder 6i.
I have the following query:
select segment1,otherfields
from po_headers_all
order by to_number(segment1)
Please note that "segment1" is a varchar2 field.
I'm using "segment1" as a group by field in the report builder wizard.
The above query doesn't give the expected ordering in report builder output while it does from Toad and i don't know why?
Can you help me please?
Regards,
|
|
|
|
Re: cannot sort varchar2 field as numeric in report builder 6i [message #247779 is a reply to message #247672] |
Wed, 27 June 2007 03:50 |
Abeer30
Messages: 110 Registered: March 2007
|
Senior Member |
|
|
hello,
my query is as follows:
select distinct ph.SEGMENT1 AS "PO Number"
,ai.INVOICE_DATE
,pl.UNIT_MEAS_LOOKUP_CODE as "Unit of Measure"
,pl.UNIT_PRICE as "Unit Price"
,pl.QUANTITY as Quantity
,(pl.QUANTITY*pl.UNIT_PRICE) as "total"
from
PO_HEADERS_ALL ph
, PO_LINES_ALL pl,
PO_VENDORS pv
, MTL_CATEGORIES_B mc
,po_line_locations_all pla
,ap_invoices_all ai
,ap_invoice_distributions_all aid
,po_distributions_all pd
where
ph.PO_HEADER_ID=pl.PO_HEADER_ID and
pv.VENDOR_ID=ph.VENDOR_ID and
pl.PO_LINE_ID=pla.PO_LINE_ID and
pla.LINE_LOCATION_ID=pd.LINE_LOCATION_ID and
pd.PO_DISTRIBUTION_ID=aid.PO_DISTRIBUTION_ID and
ai.INVOICE_ID=aid.INVOICE_ID and
(pl.QUANTITY*pl.UNIT_PRICE)<>0 and
mc.CATEGORY_ID=pl.CATEGORY_ID
Order by
TO_NUMBER(ph.SEGMENT1)
you can find the report builder output first page screenshot attached.
toad sheet is attached next message...
|
|
|
|
|
|
|