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 09:10 AM.
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.
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)....
"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
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
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
Bookmarks