SQL <SELECT> with condition

  • Thread starter Thread starter brucelim80
  • Start date Start date
B

brucelim80

hi
Can anyone help me with this problem? i am a newbie for VBA
programming.


My excel cell look like this
A B
1 user description
2 83 london
3 84 usa
4 45 italy
5 84 Rome

The sheetname is called data


How do i write an SQL statement to Extract the description where the
user is 84

SELECT * FROM [data$] Where user='83'

I have an error when executing with ADODB.Recordset: " Data type
mismatch in Criteria Expression"
Runtime error ' -2147217913 (80040e07)'

Thank you
 
Could be SELECT * FROM [data$] Where user=83 because the database
driver sees the user column as a column of type number.

You could use MSQuery to create Excel SQL queries based on Excel
workbooks, no need to actually code this.

DM Unseen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top