0% found this document useful (0 votes)
73 views1 page

Sorting Date

The document contains several sort expressions for sorting transaction date fields in different formats into either ascending or descending order. The sort expressions apply formatting and concatenation functions to the transaction date field to derive a sort key that can be sorted numerically or as text/date depending on the desired sort order.

Uploaded by

Sudha Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views1 page

Sorting Date

The document contains several sort expressions for sorting transaction date fields in different formats into either ascending or descending order. The sort expressions apply formatting and concatenation functions to the transaction date field to derive a sort key that can be sorted numerically or as text/date depending on the desired sort order.

Uploaded by

Sudha Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

SORT

<?xdofx:sort:substr(TRX_DATE,8,4)
decode(substr(TRX_DATE,4,3),'JAN',01,'FEB',02,'MAR',03,'APR',04,'MAY',05,'JUN',06,'J
UL',07,'AUG',08,'SEP',09,'OCT',10,'NOV',11,'DEC',12,00)
substr(TRX_DATE,1,2));'ascending';'text'?>

<?xdofx:sort:'20'||''||substr(TRX_DATE,8,4) ||''||
decode(substr(TRX_DATE,4,3),'JAN',01,'FEB',02,'MAR',03,'APR',04,'MAY',05,'JUN',06,'J
UL',07,'AUG',08,'SEP',09,'OCT',10,'NOV',11,'DEC',12,00)||''||
(substr(TRX_DATE,1,2));'ascending';'number'?>

<?xdofx: sort:'20'||substr(TRX_DATE,8,4) ||''||


decode(substr(TRX_DATE,4,3),'JAN','01','FEB','02','MAR','03','APR','04','MAY','05','JUN'
,'06','JUL','07','AUG','08','SEP','09','OCT','10','NOV','11','DEC','12','00')||''||
(substr(TRX_DATE,1,2)) ; 'ascending';'number'?>

<?xdofx: sort:'20'||substr(TRX_DATE,8,4) ||''||


decode(substr(TRX_DATE,4,3),'JAN','01','FEB','02','MAR','03','APR','04','MAY','05','JUN','06','JUL','07','AUG','08','SEP
','09','OCT','10','NOV','11','DEC','12','00')||''||(substr(TRX_DATE,1,2)) ; 'ascending';'number'?>

<?xdofx: sort:'20'||substr(TRX_DATE,8,4) ||'-'||


decode(substr(TRX_DATE,4,3),'JAN',01,'FEB',02,'MAR',03,'APR',04,'MAY','05','JUN','06'
,'JUL','07','AUG','08','SEP','09','OCT','10','NOV','11','DEC','12','00')||'-'||
(substr(TRX_DATE,1,2)) ; 'descending';'date'?>

<?sort:INVOICE_NUMBER;'descending';'number'?>

You might also like