Skip to Content
author's profile photo
Former Member

query to link incoming payments with deposit

hi everyone

i am looking to develop a query that can link incoming payments with the respective deposit. does anyone have any such query? can you help?

thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:52 PM

    Please use the following. It shows both check deposits and CC deposits

    SELECT 'CHECK DEPOSIT' [Deposit Type], T0.DEPOSID [Deposit No.], T0.DEPOSDATE [Deposit Date], T0.LOCTOTAL [Desposit Total],

    T2.RCPTNUM [Incoming Payment No.]

    FROM ODPS T0 INNER JOIN DPS1 T1 ON T0.DEPOSNUM = T1.DEPOSITID

    INNER JOIN OCHH T2 ON T2.CHECKKEY = T1.CHECKKEY

    WHERE T0.DEPOSTYPE = 'K'

    UNION ALL

    SELECT 'CREDIT CARD DEPOSIT', T0.DEPOSID, T0.DEPOSDATE, T0.LOCTOTAL, T1.RCTABS

    FROM ODPS T0 INNER JOIN OCRH T1 ON T0.DEPOSNUM = T1.DEPNUM

    WHERE T0.DEPOSTYPE = 'V'

    Best wishes

    Suda

    Add comment
    10|10000 characters needed characters exceeded