help with sql in excel

A

aneurin

hi i have the below sql statement

"SELECT TRUNC(FORM_XD.DAY_OF_WEEK),
TO_CHAR(FORM_XD.DAY_OF_WEEK,'HH24:MI'), FORM_XD.TEAM, FORM_XD.TALK,
FORM_XD.SALES, FORM_XD.WAIT" & Chr(13) & "" & Chr(10) & "FROM
EASY.FORM_XD _FORM_XD" & Chr(13) & "" & Chr(10) & "WHERE
(FORM_XD.TEAM=20)" & Chr(13) & "" & Chr(10) & "ORDER BY
TRUNC(FORM_XD.DAY_OF_WEEK)"

it connect to the database to a table called form_xd
and only brings in the data where team = 20
the problem i am having is that i have to state this criteria in the
sql statement

what i would like to do is to get this criteria form a cell on sheet 1

hope someone can help

aneurin
 
T

Tom Ogilvy

"WHERE
(FORM_XD.TEAM=20)"

would be

"WHERE
(FORM_XD.TEAM=" & Worksheets("Sheet1").Range("A1").Value & ")"
 

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