+ Reply to Thread
Results 1 to 4 of 4

prompt for query refresh criteria

  1. #1
    jenn
    Guest

    prompt for query refresh criteria

    can i do something to get a popup for entering a date range for a query to
    refresh with? I have a query and I often change the > date for it and then
    refresh. I do this by
    Data
    Import External
    Modify

    and change the info in the SQL box.

    is there a faster way...
    would like pop up "Greater than? "


  2. #2
    Registered User
    Join Date
    11-18-2005
    Posts
    34
    Set up your SQL to prompt you for the Date by putting "[Enter Date]" in the Value field of your Criteria box. When you run the query, a text box that says "Enter Date" will pop up for you to key the date.

    Then when you get back to Excel, you can right-click inside the area where the data is returned and choose the Parameters option. From there you can tell MSQuery a location on the worksheet from where it can retrieve the response to this query prompt.

    After that, you simply change the Date parameter on the Excel worksheet itself prior to refreshing the MSQuery.

    Hope this helps.

  3. #3
    jenn
    Guest

    Re: prompt for query refresh criteria

    thanks...
    it's beautiful...
    but it didn't work...

    I believe I have a date format issue...
    my table dates exist as 2005-10-25
    When I write queries with excel I use single quotes. do I need to put the
    quote in my critera field. Can I put the > sign in the criteria field as well?
    "taylorm" wrote:

    >
    > Set up your SQL to prompt you for the Date by putting "[Enter Date]" in
    > the Value field of your Criteria box. When you run the query, a text
    > box that says "Enter Date" will pop up for you to key the date.
    >
    > Then when you get back to Excel, you can right-click inside the area
    > where the data is returned and choose the Parameters option. From
    > there you can tell MSQuery a location on the worksheet from where it
    > can retrieve the response to this query prompt.
    >
    > After that, you simply change the Date parameter on the Excel worksheet
    > itself prior to refreshing the MSQuery.
    >
    > Hope this helps.
    >
    >
    > --
    > taylorm
    > ------------------------------------------------------------------------
    > taylorm's Profile: http://www.excelforum.com/member.php...o&userid=28892
    > View this thread: http://www.excelforum.com/showthread...hreadid=546838
    >
    >


  4. #4
    Registered User
    Join Date
    11-18-2005
    Posts
    34

    Re: prompt for query refresh criteria

    Assuming that the date that you showed as an example (2005-10-25) is actually a text field and not a date field (because I don't think that's a valid Access date format), the you need to format the parameter cell on your spreadsheet as text and enter it exactly as you had in your example (2005-10-25). I created a test database with the date field being a text field and it worked for me.

    Another option you have is to check the "Prompt for value using the following string" option and it will pop up a text box for you to key the date into when you Refresh the query. Again, you would need to type it in that format (2005-10-25).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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