gmaxey
11-07-2013, 09:14 AM
I'm trying to load data from a Excel worksheet into a listbox. I only want the data where the value in column D (or four) is equal to one of three distinct values. I can't seem to get the SQL statement worked out.
The following works to load "all" the records:
m_oRecordSet.Open "SELECT * FROM [StaffData$], m_oConn, 3, 1"
I only want to load the records where the value in column D is "BPT" or "GPT" or "BP" this is one of several things I've tried, but all attempts returns a connection error:
m_oRecordSet.Open "SELECT * FROM [StaffData$] WHERE D='BPT' OR D='GPT' OR D='BP', m_oConn, 3, 1"
Thanks for any assistance:
The following works to load "all" the records:
m_oRecordSet.Open "SELECT * FROM [StaffData$], m_oConn, 3, 1"
I only want to load the records where the value in column D is "BPT" or "GPT" or "BP" this is one of several things I've tried, but all attempts returns a connection error:
m_oRecordSet.Open "SELECT * FROM [StaffData$] WHERE D='BPT' OR D='GPT' OR D='BP', m_oConn, 3, 1"
Thanks for any assistance: