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

Thread: Query Help

  1. #1
    Join Date
    Apr 2007
    Posts
    3

    Query Help

    I have two tables invoice and payments

    invoice has following columns :

    period,customerid,producttype,cashapplyseq,invoiced_amount

    data

    Jan , 10001, X,3,10.00
    Jan, 10001,Y,5,20.00
    Jan,10001,A,1,5.00
    Feb,10001,A,1,5.00
    Mar,10001,A,1,5.00
    Apr,10001,A,1,10.00
    Apr,10001,B,2,5.00

    Payment table :

    period,customerid,collectedcash,collectedserialno
    Jan ,10001,35.00,1
    Mar ,10001,5.00,2
    Apr ,10001,7.00,3
    Need help to show the below data using a query :
    invoiceperiod,cid,type,cashappliedseq,invoicedcash,postedcash,paidperiod
    Jan , 10001 ,X, 3, 10.00 , 10.00 ,Jan
    Jan , 10001, Y, 5, 20.00, 20.00,Jan
    Jan , 10001, A,1, 5.00, 5.00,Jan
    Feb ,10001, A, 1, 5.00, 5.00,Mar
    Mar,10001,A,1,5.00,5.00,Mar
    Apr,10001,A,1,10.00,7.00,Apr
    Apr,10001,B,2,5.00,0,Apr

    This is similar to cr/db posting in banking ...

    Any thoughts ?

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    I'm wondering what the problem is... have you even give it a try?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

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