Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Data

I am trying to pass a SQL query with variables in the
WHERE clause through the external data function and can't
seem to get it to work. For instance, I want to pull back
a specific property or a group and the cash flows for the
last year depending on variables my user inputs using a
drop down. Any suggestions would be very appreciated.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default External Data

It woulf be useful to see your code.
however, your WHERE should look something akin to


DIM sSQL as String

sSQL ="Select [Field1],[Field2][,[fieldn]] FROM mytable WHERE [ThisField] =
'" & textbox1.text & "'"
sSQL = sSQL & " AND MyValue = " & txtbox2.text & ";"

note that for char type fields, wrap your text in single quotes. Numeric
fields don't need the quote

--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"James" wrote in message
...
I am trying to pass a SQL query with variables in the
WHERE clause through the external data function and can't
seem to get it to work. For instance, I want to pull back
a specific property or a group and the cash flows for the
last year depending on variables my user inputs using a
drop down. Any suggestions would be very appreciated.

Thank you.



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
External Data Warning Message - I have No External Data in wrkbk Cass_makeitfun[_2_] Excel Discussion (Misc queries) 0 May 12th 10 09:02 PM
Getting External Data based on criteria insde of the external data BigMacExcel Excel Discussion (Misc queries) 0 August 31st 09 06:41 PM
Tying to extract all data from a pivot pulling from external data Ted Urban Excel Discussion (Misc queries) 3 September 14th 07 10:50 AM
updating external data sheet causes loss of data on linked pages C_F_Dewey Excel Worksheet Functions 0 August 28th 07 11:48 PM
External Data Queries - Data Range Properties v Spreadsheet Format HLS Excel Discussion (Misc queries) 0 April 5th 06 11:09 AM


All times are GMT +1. The time now is 07:12 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"