OrdImp \\seizstream\stream\stream\Livedata\FFdatabase\sysDB 01 0100 8 { for $DELFOR in /EDIFACT/DELFOR return 11 BMWW OB BMWW { for $GROUP_20 in $DELFOR/GROUP_18/GROUP_20 order by $GROUP_20/DTM/DTM01/DTM0102 return { $DELFOR/GROUP_18/LIN/LIN03/LIN0301/text() } { $GROUP_20/QTY/QTY01/QTY0102/text() } { for $DTM0102 in $GROUP_20/DTM/DTM01/DTM0102 let $x := xs:string(xs:integer($DTM0102) div 10000) where $DTM0102 >= 9 return xs:date(concat(substring($x,1,4),'-',substring($x,5,2),'-',substring($x,7,2),'')) } } } (: Stylus Studio meta-information - (c) 2004-2009. Progress Software Corporation. All rights reserved. :)