SELECT
  [HSTYEAR] AS hstyear,
  [JRNENTRY] AS jrnentry,
  [RCTRXSEQ] AS rctrxseq,
  RTRIM([SOURCDOC]) AS sourcdoc,
  RTRIM([REFRENCE]) AS refrence,
  RTRIM([DSCRIPTN]) AS dscriptn,
  [TRXDATE] AS trxdate,
  [ACTINDX] AS actindx,
  RTRIM([TRXSORCE]) AS trxsorce,
  [POLLDTRX] AS polldtrx,
  RTRIM([LASTUSER]) AS lastuser,
  [LSTDTEDT] AS lstdtedt,
  RTRIM([USWHPSTD]) AS uswhpstd,
  RTRIM([ORGNTSRC]) AS orgntsrc,
  [ORGNATYP] AS orgnatyp,
  [QKOFSET] AS qkofset,
  [SERIES] AS series,
  [ORTRXTYP] AS ortrxtyp,
  RTRIM([ORCTRNUM]) AS orctrnum,
  RTRIM([ORMSTRID]) AS ormstrid,
  RTRIM([ORMSTRNM]) AS ormstrnm,
  RTRIM([ORDOCNUM]) AS ordocnum,
  [ORPSTDDT] AS orpstddt,
  RTRIM([ORTRXSRC]) AS ortrxsrc,
  [OrigDTASeries] AS origdtaseries,
  [OrigSeqNum] AS origseqnum,
  [SEQNUMBR] AS seqnumbr,
  [DTA_GL_Status] AS dta_gl_status,
  [DTA_Index] AS dta_index,
  RTRIM([CURNCYID]) AS curncyid,
  [CURRNIDX] AS currnidx,
  RTRIM([RATETPID]) AS ratetpid,
  RTRIM([EXGTBLID]) AS exgtblid,
  [XCHGRATE] AS xchgrate,
  [EXCHDATE] AS exchdate,
  [TIME1] AS time1,
  [RTCLCMTD] AS rtclcmtd,
  [NOTEINDX] AS noteindx,
  [ICTRX] AS ictrx,
  RTRIM([ORCOMID]) AS orcomid,
  [ORIGINJE] AS originje,
  [PERIODID] AS periodid,
  [DEBITAMT] AS debitamt,
  [CRDTAMNT] AS crdtamnt,
  [ORDBTAMT] AS ordbtamt,
  [ORCRDAMT] AS orcrdamt,
  [DOCDATE] AS docdate,
  [PSTGNMBR] AS pstgnmbr,
  [PPSGNMBR] AS ppsgnmbr,
  [DENXRATE] AS denxrate,
  [MCTRXSTT] AS mctrxstt,
  RTRIM([CorrespondingUnit]) AS correspondingunit,
  [VOIDED] AS voided,
  [Back_Out_JE] AS back_out_je,
  [Back_Out_JE_Year] AS back_out_je_year,
  [Correcting_JE] AS correcting_je,
  [Correcting_JE_Year] AS correcting_je_year,
  [Original_JE] AS original_je,
  [Original_JE_Seq_Num] AS original_je_seq_num,
  [Original_JE_Year] AS original_je_year,
  [Ledger_ID] AS ledger_id,
  [Adjustment_Transaction] AS adjustment_transaction,
  RTRIM([APRVLUSERID]) AS aprvluserid,
  [APPRVLDT] AS apprvldt,
  [DEX_ROW_TS] AS dex_row_ts,
  [DEX_ROW_ID] AS dex_row_id
FROM [GPSERVER].[CHG].[dbo].[GL30000]
WHERE 
    [DEX_ROW_ID] >= {dex_row_id}
