Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Using ADO to Excel with this Query will not work?

I'm using ADO inside Excel to get data from another Excel workbook.

Using either the ODBC Driver for Excel or the OLE DB for Jet, I can do
this with success:

sql = "SELECT * FROM Sheet1$ WHERE F7 = 'Value'"

rs.Open sql, cn

I can use this sql, too:

sql = "SELECT * FROM Sheet1$ WHERE F7 = 'Value' AND F16 LIKE '%Value
%'"

But when I try to sum like this:

sql = "SELECT SUM(F10) FROM Sheet1$ WHERE F7 = 'Value' AND F16 LIKE
'%Value%'"

I get Null.

What should I do?

tod





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Using ADO to Excel with this Query will not work?

F10 is definitely numeric ?

Can you show the next couple of lines where you're accessing the resultset ?

Tim


"todtown" wrote in message
...
I'm using ADO inside Excel to get data from another Excel workbook.

Using either the ODBC Driver for Excel or the OLE DB for Jet, I can do
this with success:

sql = "SELECT * FROM Sheet1$ WHERE F7 = 'Value'"

rs.Open sql, cn

I can use this sql, too:

sql = "SELECT * FROM Sheet1$ WHERE F7 = 'Value' AND F16 LIKE '%Value
%'"

But when I try to sum like this:

sql = "SELECT SUM(F10) FROM Sheet1$ WHERE F7 = 'Value' AND F16 LIKE
'%Value%'"

I get Null.

What should I do?

tod







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
Use MS Query to query data within the current work book Steve Kesler Excel Discussion (Misc queries) 0 August 6th 09 05:22 PM
Cannot get Query Wizard to work in Excel Seamus O'Connell Excel Discussion (Misc queries) 0 January 23rd 08 01:27 AM
Excel Query Does not Work [email protected] New Users to Excel 1 January 28th 07 06:30 AM
web query on EXCEL does not work. Why? jimf Excel Discussion (Misc queries) 1 January 4th 06 05:09 AM
Access query does not work in Excel Ake Excel Programming 1 July 5th 05 01:51 PM


All times are GMT +1. The time now is 01:02 AM.

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

About Us

"It's about Microsoft Excel"