+ Reply to Thread
Results 1 to 2 of 2

User input (drop-down or fill in a cell) changes sql query parameters

  1. #1
    Registered User
    Join Date
    08-09-2018
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    User input (drop-down or fill in a cell) changes sql query parameters

    Hello,

    My goal is for the user (who needs info on past shipments) to input the info they know to filter the data set and find all shipments with the parameter they select.

    I currently have a query that pulls data into a table and the user filters on that table. I have a separate sheet for each location running all data for 2019, but the file is huge and my users won't always know which location to select to filter their data. So instead of them having to click through each sheet (30 sheets in all) and filter on each table, I'd like to include a drop-down menu (or several) on a landing sheet that the user can filter the data and the output would contain only the shipments they're searching for.

    I need drop-down menus for the headers in my "select" statement. My preference is for the user to input as many of these headers as they know, and the query runs based on their input. So if they only know the "order_nbr" and/or "item_txt", it would output all data related to the shipments with those matching parameters.

    My sql query is located in the "command text" section in connection properties within the excel file. How do I accomplish my goal?

    Here's my current query:

    select
    shpd_dt, shpmt_nbr, ord_nbr as order_number, sellng_loc_cd as brwy, shp_to_cust_nbr as CUST, item_txt as PRODUCT, inv_ln_qty

    from
    JPE.SHPMT_COD_UP

    where
    ln_prod_grp_cd = 'PRODUCT'
    and to_char(shpd_dt, 'YYYY') in ('2019')
    and shpmt_nbr like '2%'
    and sellng_loc_cd in ('TEXAS')
    order by shpd_dt asc

  2. #2
    Registered User
    Join Date
    06-11-2022
    Location
    new york
    MS-Off Ver
    Microsoft Office 2019
    Posts
    6

    Re: User input (drop-down or fill in a cell) changes sql query parameters

    let me know if you get to know .. i have same query ..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Having user input and a formula (that can incorporate the user input) in the same cell.
    By Super_Bob in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-21-2018, 05:55 AM
  2. VBA to fill in cell data after the user picks from drop down box.
    By Zimmerman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2015, 03:03 PM
  3. How to fill a table using 2x input parameters in the existing spreadsheet
    By pharley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2013, 01:56 AM
  4. Dynamic Web Query with multiple input parameters
    By Lukasz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2010, 12:12 AM
  5. Replies: 0
    Last Post: 05-20-2009, 10:40 PM
  6. web query - fill col K with a value based on parameters from Col A,C & D
    By cdinca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2008, 02:54 PM
  7. Query SQL DB with few drop down parameters
    By USBFreak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2007, 07:47 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1