External Data

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.
 
P

Patrick Molloy

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
 

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

Top