• λ我爱Aspx >> Asp.Net >> ASP中关于SQL查询
  • ASP中关于SQL查询

  • :aspxer  Դ:csdn  :2007-7-6 2:52:00  ؼ:asp,sql
  • 表名:hhhh

    google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";

    id name jiage date

    1 xxxx 2000 2006-6-18

    2 yyyy 200000 2006-6-18

    3 zzzz 200 2006-6-18

    4 aaaa 500 2006-6-18

    5 aaaa 400 2006-6-18

    6 aaaa 800 2006-6-18

    7 aaaa 400000 2006-6-18

    我的问题是

    有俩个输入表单 前面文本框(jg)输入200 后面的文本框(jg1)中输入300000

    我要查询jiage 条件为200-300000之间的列

    我使用的sql语句是这样的

    jg = trim(Request.Form("jg"))

    jg1 = trim(Request.Form("jg1"))

    这是传值

    SQL语句如下

    if jg<>"" and jg1<>"" then

    sql = "select * from hhhh where jiage>""&jg&"" and jiage<""&jg1&"" order by id desc"

    end if

    rs.open sql,conn,1,1

    貌似可以实现此功能。但是查询相当不正确。比如查1000-5000

    里面也有200 500之类。

    还请大家帮忙

    第2楼. 由 ghaihua 于 2007-6-26 15:51:00 发表

    sql = "select * from hhhh where jiage>"&jg&" and jiage<"&jg1&" order by id desc"

    Ҷƪл˵?
  • һƪ关于搜索的问题,请各位朋友帮忙下
    һƪ求一邮件服务器软件基于win2003系统下面