跪求变更ASP的搜索条件

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:24:26
<table width="1104" border="0" cellspacing="0" cellpadding="0" align="center">
<form name="form1" method="post" action="index.asp">
<tr>
<td width="317"> </td>
<td width="127">
<input type="text" name="LouHB_Key" size="20"></td>
<td width="127">
<select name="LouHB_Type2" type="text" size=1 class="button1">
<option value="L_JueSheMC">资金帐号</option>
<option value="L_GouMaiRQ">开户日期</option>
</select></td>
<td width="153">
<select name="LouHB_Type" type="text" size=1 class="button1">
<option value="1">男</option>
<option value="2">女</option>

Sql="Select * From LHB_UserInfo where L_WaiGuaZL = "&L_Type&" And "&L_Type2&" like '%"&L_Key&"%'"

就改这一句就行了。删掉
L_WaiGuaZL = "&L_Type&" And

就是只搜男女

删掉
And "&L_Type2&" like '%"&L_Key&"%'

就是只搜资金帐号或者开户日期

例如只用"资金帐号"..下拉框作为查询条件:
Sql="Select * From LHB_UserInfo where L_WaiGuaZL = "&L_Type&" And "&L_Type2&" like '%"&L_Key&"%'"

改成:
Sql="Select * From LHB_UserInfo where "&L_Type2&" like '%"&L_Key&"%'"

前题是数据库中有"资金帐号"; "开户日期"等字段

也可以这样:
<select name="LouHB_Type" type="text" size=1 class="button1">
<option value="0">全部</option>
<option value="1">男</option>
<option value="2">女&l