DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: how to do this ??

  1. #1
    Join Date
    Nov 2000
    Posts
    198
    I have a table like this

    receipts_amt---fpn---date_run
    ------------------------------------
    5000----------X01---03/15/2001
    4000----------X01---04/15/2001

    How can I get the difference of the receipts based on the date??? ( 5000-4000)

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    SELECT C.RECEIPTS_AMT - D.RECEIPTS_AMT
    FROM (SELECT RECEIPTS_AMT FROM AMT A WHERE ROWID < ( SELECT MAX(ROWID) FROM AMT B WHERE A.FPN =B.FPN) ) C,
    (SELECT RECEIPTS_AMT FROM AMT A WHERE ROWID > ( SELECT MIN(ROWID) FROM AMT B WHERE A.FPN =B.FPN) ) D
    /

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width