Results 1 to 3 of 3

Thread: Query help!

  1. #1
    Join Date
    Dec 2003
    Posts
    19

    Unhappy Unanswered: Query help!

    This is the normal query.

    select part_no,ord_date,ord_recieved,ord_completed from tab1,tab2,tab3,tab4
    where ...................


    but i need output like this.......

    part_no 01-jan 02-jan ...... 31-jan

    ord_recd ord_comp ord_recd ord_comp ord_recd ord_comp

    pnxx xx xx xx xx xx xx


    for each partno in that corresponding month each day i need order received and order completed detail like above.order date not available for all days in months.So how to get all days from start to end and 0 for order details if orderdate not available.I am using oracle 8i and front end is vb6.
    I am displaying in third party grid control for excel download.Thanks in advance!

  2. #2
    Join Date
    Jul 2004
    Posts
    2
    show me the structure of ur table tab1, tab2, etc....
    U may use...outer join...it may help u out...

  3. #3
    Join Date
    Dec 2003
    Posts
    19
    This is the sample standard query...........I think it will help u to gimme solution....I need output for selected partno alone.

    Select
    B.PROD_GROUP||B.GB_COL2 partno
    , C.SO_DATE
    , NVL(SUM(A.SO_QTY),0) OrderRecieved
    , NVL(SUM(A.SO_QTY_DESP),0) OrderCompleted
    From
    A,B,C,D
    Where
    C.SO_YEAR = A.SO_YEAR
    And C.SO_NO = A.SO_NO
    And A.SO_YEAR = D.JOB_SO_YEAR
    And A.SO_NO = D.JOB_SO_NO
    And A.SO_SL_NO = D.JOB_SO_SL_NO
    And A.SO_PART_NO = B.PART_NO
    And C.SO_DATE >= '01-dec-2003'
    And C.SO_DATE <= '31-dec-2003'
    and B.PROD_GROUP||B.GB_COL2 in ('AS16','AS20','AS25','AS30','AS35','AS45','AS55',
    'AS60','TA30','TA35','TA40','TA45','TA50','TA60')
    Group By
    B.PROD_GROUP||B.GB_COL2
    , C.SO_DATE

Posting Permissions

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