Loading ...
Sorry, an error occurred while loading the content.
 

RE: Help on a Query

Expand Messages
  • Andrew Mills
    Thought I would give more data in the event someone is able to help. Here are the tables: trn_gm_serial_number: GM_SERIAL_NUMBER_ID NUMBER {null} NOT NULL
    Message 1 of 2 , Sep 28, 2011
      Thought I would give more data in the event someone is able to help.







      Here are the tables:

      trn_gm_serial_number:
      GM_SERIAL_NUMBER_ID NUMBER {null} NOT NULL {null}
      GM_MASTER_ID NUMBER {null} {null} {null}
      GM_SERIAL_NUMBER VARCHAR2 (20) {null} NOT NULL {null}
      RECEIVED_BY NUMBER {null} {null} {null}
      RECEIVED_DATE DATE {null} {null} {null}
      PICKED_BY NUMBER {null} {null} {null}
      PICKED_DATE DATE {null} {null} {null}
      EBIZ_SKU_NO NUMBER {null} {null} {null}
      COMP_ID VARCHAR2 (10) {null} NOT NULL {null}
      SITE_ID VARCHAR2 (12) {null} NOT NULL {null}
      EBIZ_ORD_NO NUMBER {null} {null} {null}
      INTERFACE_DATE DATE {null} {null} {null}

      Scan Date: if a value is entered, you would search on the "Received_Date /
      Picked_Date" depending upon the selection of "Scan Type"
      Group By: This will group the results based upon the selection of the user
      (Scan Type, SKU, Teammate). SKU is from the table, teammate is from the
      table (again, depends upon the
      selection of "Scan Type" as "INBOUND" would select on the "Received_By",
      OUTBOUND would search on the "Picked_By" and BOTH would search on both
      columns
      Scan Type: Possible values: "INBOUND, OUTBOUND, BOTH" and determines if the
      records are searched on the "REceived / Picked" line....

      Data:
      SN_ID M_ID SerialNum Received_By Received_Date Picked_By Picked_Date Comp_ID
      Site_ID Ebiz_Ord_No Interface_Date
      538 23 J6691822 1 2011-04-08 1 2011-04-08 XE OHIO 76578 2011-06-09 12:58:13
      539 23 J6691828 1 2011-04-08 1 2011-04-08 XE OHIO 76578 2011-06-09 12:58:13





      From: Andrew Mills [mailto:amills@...]
      Sent: Tuesday, September 27, 2011 12:13 PM
      To: 'SQLQueriesNoCode@yahoogroups.com'
      Subject: Help on a Query



      Hello Everyone:



      I am not sure how to go about building this query and hoping someone could
      help.



      I have table trn_gm_serial_number with the following fields:

      GM_SERIAL_NUMBER_ID NUMBER


      GM_MASTER_ID NUMBER

      GM_SERIAL_NUMBER VARCHAR2 (20)

      RECEIVED_BY NUMBER


      RECEIVED_DATE DATE


      PICKED_BY NUMBER


      PICKED_DATE DATE


      EBIZ_SKU_NO NUMBER


      COMP_ID VARCHAR2 (10)


      SITE_ID VARCHAR2 (12)


      EBIZ_ORD_NO NUMBER


      INTERFACE_DATE DATE



      The user will select the following:



      Scan Date

      Scan Type

      (Inbound, Outbound, Both)

      Teammate

      Group By (scan type, sku, teammate)

      SKU



      Inbound / Outbound determine the type of report wanted. Inbound is the
      "Received" columns and outbound is the "Picked" columns. If they pick
      both, we want all data, if they pick Inbound, we only want where Picked_Date
      is null and if they pick outbound, we only want to include ones where Picked
      By has a value. Then the corresponding teammate is included (Inbound =
      Received By, Outbound = Picked By, Both = both)



      Then we will group the results based upon the "Group By" column.



      I am not sure how to do this and looking for help. The part that is really
      confusing me is the "Scan Type" logic and making Group By changeable..



      Thanks,

      Andy Mills





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.