SELECT DSF.systemcode as sys_id , (select g.SCRDESC from genlaw.R_SCREEN g where g.SYSTEMCODE = dsf.SYSTEMCODE and g.PROGRAMCODE = dsf.PROGRAMCODE and g.SCRNBR IN (select min(g2.SCRNBR) from genlaw.R_SCREEN g2 where g2.PROGRAMCODE = g.PROGRAMCODE)) as screen_desc , trim(dsf.programcode) || '.' || to_number(dsf.scrnbr,'99') as Form_ID , FD.Prefix as tbl_prfx , FD.Filename as tbl_name , replace(substr(DSF.scrfldname,5),'-','_') as col_name , FD.Prefix || '.' || replace(substr(DSF.scrfldname,5),'-','_') as tbl_col , DSF.Scrfldname as field , DSF.docfldname as fld_desc FROM genlaw.docscrfld DSF LEFT JOIN genlaw.filedef FD ON substr(dsf.scrfldname,1,3) = FD.Prefix WHERE DSF.programcode = upper('{?Form}') -- CR Parameter AND substr(DSF.scrfldname,4,1) = '-' ORDER BY dsf.programcode , dsf.scrnbr