Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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



All times are GMT +1. The time now is 04:45 PM.

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"