Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with sql in excel
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with sql in excel
"WHERE
(FORM_XD.TEAM=20)" would be "WHERE (FORM_XD.TEAM=" & Worksheets("Sheet1").Range("A1").Value & ")" -- Regards, Tom Ogilvy "aneurin" wrote in message om... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|