+ Reply to Thread
Results 1 to 2 of 2

sql that will refer to a cell in excel

  1. #1
    zero6060
    Guest

    sql that will refer to a cell in excel

    How can I write a sql statement that will refer to a cell in excel.
    I would like to do a date range like =<"B2" and =>"B3"
    and a parameter =<"C2" and =>"C3"

    You get my point...

    I didn't want to write the statement in excel, because excel is slow pulling
    data from a huge data base (up to a minute) using several tables, where if I
    write the sql directly to the data base it returns data in just a few
    seconds. But then I can't use excels convenient parameters

  2. #2
    NickHK
    Guest

    Re: sql that will refer to a cell in excel

    Assuming this in VBA:
    Dim SQLString as string
    SQLString="SELECT * FROM YourTable WHERE IssueDate <= #" & Range("B2").Value
    & "# AND IssueDate >= #" & Range("B3").Value & "#"

    The exact syntax will depend on the database provider/engine etc you are
    using, but something like that.

    NickHK

    "zero6060" <zero6060@discussions.microsoft.com> wrote in message
    news:FE97D9E1-D623-4F21-8940-78ED01F886FA@microsoft.com...
    > How can I write a sql statement that will refer to a cell in excel.
    > I would like to do a date range like =<"B2" and =>"B3"
    > and a parameter =<"C2" and =>"C3"
    >
    > You get my point...
    >
    > I didn't want to write the statement in excel, because excel is slow

    pulling
    > data from a huge data base (up to a minute) using several tables, where if

    I
    > write the sql directly to the data base it returns data in just a few
    > seconds. But then I can't use excels convenient parameters




+ 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