当前位置:编程学习 > asp >>

基于ASP工资管理系统,按时间查询工资单怎么实现

<select name="select_t" size="1"> <option value="0" >请选择查询时间</option> <% dim char(20) i=0 see=0 sql="select * from jhgz " set time_rs=server.CreateObject("adodb.recordset") time_rs.open sql,conn,1,1 do while Not time_rs.EOF for j=0 to i if char(j) = month(time_rs("time")) then see=1 exit for else see = 0 end if next if see=0 then char(i)=month(time_rs("time")) %> <option value="<%=time_rs("time")%>" selected="selected"><%=time_rs("time")%></option> <% 'char(i)=time_rs("time") i=i+1 end if time_rs.movenext loop time_rs.close set time_rs = nothing %> </select> 代码这样 高手给我解释下哈 谢了
追问:能不能概括的和我说下是怎么实现的啊?比如 先做什么然后怎么样,谢谢了代码是什么意思,是不是在一个表里搜索相关的记录,然后有就显示,没有就再搜索哦哦  嘿嘿我是菜鸟,学了三年计算机还是不懂,总结一下就是用什么语句来实现这个功能的啊?
答案:呵呵  这样编写浪费资源啊  

先列出所有记录
用FOR 循环进行对比 
如果找到符合要求的  就SEE=1 t退出循环  否则就 SEE=0 
下面是 如果SEE=1 就显示这条记录  

大致就这个意思

上一个:学习 ASP.NET 有什么快速的方法?
下一个:asp在关键字 'user' 附近有语法错误

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,