|
| |
|
|
chadb
Posts: 468 From: Kansas Status: online
|
Drop Down sql select value - 5/7/2008 11:48:38
I have a dropdown list that I am trying to select that value from. Here is the drop down box: <select size="1" name="WorkCenter"> <option selected value="%">All</option> <option value="Assy">Assembly</option> <option value="3SCREW">Screw</option> </select> here is the select statement. fp_sQry="SELECT * FROM Item WHERE (wc like '::workcenter::')" It will not return any records, if I change it to one of the values of the drop down, it works: fp_sQry="SELECT * FROM Item WHERE (wc = 'assy')"
|
|
|
|
rdouglass
Posts: 9137 From: Biddeford, ME USA Status: online
|
RE: Drop Down sql select value - 5/7/2008 12:42:27
quote:
WHERE (wc like '::workcenter::')" Like requires the "%" wildcard character. (wc like '%::WorkCenter::%') : "contains" (wc like '::WorkCenter::%') : "begins with" (wc like '%::WorkCenter::') : "ends with" That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
chadb
Posts: 468 From: Kansas Status: online
|
RE: Drop Down sql select value - 5/7/2008 12:46:00
could I use fp_sQry="SELECT * FROM Item WHERE (wc = '::assy::')" if it is the exact value I have in <option value="Assy">Assembly</option> ?? Because this does not work.
|
|
|
|
rdouglass
Posts: 9137 From: Biddeford, ME USA Status: online
|
RE: Drop Down sql select value - 5/7/2008 12:50:00
quote:
fp_sQry="SELECT * FROM Item WHERE (wc = '::assy::')" Nope, because "assy" is not the name of the form field. See the :: double colon sign in the FrontPage DRW is kinda' shorthand for "Request.Form" so what you're saying is Request.Form("assy") which there is none. You can do: "SELECT * FROM Item WHERE (wc = 'assy')" but that's hard-coding the value and I don't think that's what you want to do is it? Also, double check your capitalization for your fields and such; it can make a diff. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
chadb
Posts: 468 From: Kansas Status: online
|
RE: Drop Down sql select value - 5/7/2008 12:54:32
OK, so (wc = '::assy::')" the assy needs to be the name of the drop down box, in my case WorkCenter, so (wc = '::WorkCenter::')" then the sql string would be, if the value if the dropdown box is "Assy" is would be (wc = 'Assy')" right?? Thanks
|
|
|
|
DesiMcK
Posts: 407 Joined: 4/26/2004 From: Essex, UK Status: offline
|
RE: Drop Down sql select value - 5/7/2008 14:51:29
Hi chadb, quote:
so (wc = '::assy::')" the assy needs to be the name of the drop down box, in my case WorkCenter, so (wc = '::WorkCenter::')" then the sql string would be, if the value if the dropdown box is "Assy" is would be (wc = 'Assy')" right?? You are right. Hope it works, Desi
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|