External Data

  • Thread starter Thread starter James
  • Start date Start date
J

James

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.
 
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
 
Back
Top