dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Search an excel spreadsheet with sql

  1. #1
    Join Date
    Jan 2005
    Posts
    209

    Question Search an excel spreadsheet with sql

    date date date
    6-Feb 7-Feb 8-Feb
    Time 6-Mar 7-Mar 8-Mar
    1 A B C
    2 B C D


    My excel page is like the above. I need to look up the month and time and get back the letter using sql. For example it could look up apr and 1.00 and return A or look up mar and 2.00 and bring back D. Any ideas on how to write the sql considering that this is an excel spreadsheet? PS I've already made the connection etc, I just need some clues on the sql?

    Thanks!
    Last edited by Funkymonkey; 04-06-2006 at 10:10 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    The only SQL functionality in Excel is to allow you to attach a database lookup into a cell in your worksheet. There is no SQL functionality for searching the worksheet itself.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,633
    I thought I vaguely remembered some way to query Excel sheets via some ODBC connection? I'm off to msdn to see if I can refresh my memory (or confirm its well-known defectiveness)....

    PS: http://msdn.microsoft.com/library/de...se_drivers.asp
    Last edited by NogDog; 04-06-2006 at 09:13 PM.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,633
    I think for your spreadsheet to function as a database, the very first row needs to be column names, thus each column of the first row should have a distinct value. I'm not sure what restrictions might be on column names, but it would probably be best to start with a letter, and only use letters, digits, and underscores for the name.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,633
    For whatever it's worth, in its comparatively short lifetime the SQL forum is close to passing the Accessibility, Dreamweaver/Frontpage, and Domain Names forums in number of threads.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles