Results 1 to 3 of 3

Thread: SQL statement

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51
    i have two table
    WorkOrder(WorkOrderNO, TotalQty)
    Rework(WorkOrderNo, DefectQty, RepairQty, ScrapQty)

    How can join this two table and show out the workorderno, the sum of defectqty, repairqty and totalqty?

  2. #2
    Guest

    Talking *Luaghing*

    If you have Access, Why not using the Query SQl designer.
    It's real easy to use (Drag and Drop).

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You can do something like this:

    Code:
    SELECT
        WO.WorkOrderNO, 
        Sum(RE.DefectQty) As Summary, 
        RE.RepairQty, 
        WO.TotalQty 
    FROM
        WorkOrder WO, 
        Rework RE 
    WHERE 
        WO.WorkOrderNO = RE.WorkOrderNO
    GROUP BY
        WO.WorkOrderNO

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