Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    MN
    Posts
    10

    Post Unanswered: pl/sql or a nasty sql statement

    Using 9.0.1--
    Heres the deal, I need to sum two different fields from two different tables. One table has expense and the other table has SRP. (SRP+Expense=the total I need). These two tables cant be joined or Ill get an expense or each SRP (I cant join them).
    Im trying to pass all the records from each of the tables into two different index-by-tables and sum the two together. The problem is that not all SRPs have a matching expense, so the number of records is different in each of the index-by-tables. This used to be done in MS Access with a series of make-table and append queries that Id have to step through. Im pretty sure I can use some dynamic sql to create a dump table on the fly and group by it, but Id rather not get that desperate yet. Any input would be very much appreciated.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    can you make two seperate statements foreach table?

    if so, then you can add them together.
    or, are you looking to add together for specific rows and not one SUM + SUM?

    Post both queries.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Aug 2003
    Location
    MN
    Posts
    10
    Originally posted by The_Duck
    can you make two seperate statements foreach table?

    if so, then you can add them together.
    or, are you looking to add together for specific rows and not one SUM + SUM?

    Post both queries.

    THX for the help
    I've attached a file that might help.
    This is the closest so far...has all the correct data and calcs, but data is on muliple lines. col1 from one table plus col2 from another table. all on the same line
    Attached Files Attached Files

Posting Permissions

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