+ Reply to Thread
Results 1 to 2 of 2

Selecting dynamic date range

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Post Selecting dynamic date range

    Hi,

    I have an sql query in Excel Existing connections through which i am able to pull the data. I am giving the required date range manually in sql query and pulling the data.

    Is there a possibility so that I can give the start date and the end date in excel. (Ex: Sheet1!A1 has the start date and Sheet1!B1 has the end date).

    Now the sql macro should take the input of start and end date from excel and pull the date.

    Please help me how to do that.

    Below is the sql query with me..

    select Naming, Date, Fields, Numbers
    from HJDU
    where Fields in (23, 25, 27)
    and
    Numbers in (1,2,3)
    and
    Date >=2013-09-01 and Date <=2013-09-30
    order by Date


    Here what i want dynamically is to pull the previous month data.

    Thanks in advance.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Selecting dynamic date range

    It's difficult to visualize how you are running/setting the SQL, if you're doing it through an Excel's macro, you can try something like this:
    Please Login or Register  to view this content.

+ 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. Error when selecting Date Range for Dynamic Charts
    By lindomsm in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-08-2013, 03:20 PM
  2. Error when selecting dynamic range
    By BoRdo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-03-2012, 09:04 AM
  3. Selecting a Dynamic Range
    By kyleg222 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-12-2012, 03:40 PM
  4. [SOLVED] Selecting a dynamic range
    By Alex Nayar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2005, 04:05 PM
  5. selecting a dynamic range
    By Alan M in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2005, 06:05 AM

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