Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SQL <SELECT with condition


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


--
brucelim80
------------------------------------------------------------------------
brucelim80's Profile: http://www.excelforum.com/member.php...o&userid=32244
View this thread: http://www.excelforum.com/showthread...hreadid=520460

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default SQL <SELECT with condition

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
programming to select rows based on condition Farhad Excel Discussion (Misc queries) 4 January 14th 10 01:18 AM
How to select the value based on given condition? Eric Excel Discussion (Misc queries) 2 October 30th 07 01:06 AM
How to select certains records meeting a certain condition !!!! CLR Excel Worksheet Functions 0 November 29th 06 05:46 PM
How to randomly select from a list with condition kathyxyz Excel Worksheet Functions 5 July 27th 05 04:19 PM
Excel formula: select value in column if condition in 2nd col met Rapidcat Excel Programming 2 October 6th 04 11:26 AM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"