根据所在城市和房屋价格,还有订单情况,确定所查询的房屋是否有空闲
现有两个表dfzx(房屋信息表)和dfdd(订房订单表),现在我想做一个搜索,就是根据所在城市和房屋价格,还有订单情况,确定所查询的
时间段内房屋是否有空闲,其表结构如下:
dfzx表 city_y_char 城市
bh_y_id_h 房屋编号
dfdd表 fwh_y_int 房屋编号
ksrq_y_date 开始日期
jsrq_y_date 结束日期
我只知道分别从两个表中查询,但不知道怎样把下面的两个语句合起来
'从房屋信息表中查询房源
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from dfzx where city_y_char like '%"&replace(request("city_y_char"),"'","") order by bh_y_id_h
desc",conn,1,1
do while not rs.eof
'从订房订单表中查询,查询房屋是否在检索的时间段内有订单,
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from dfdd where fwh_y_int="&rs("bh_y_id_h") and ksrq_y_date<='"&request("jsrq_y_date")&"'
and jsrq_y_date>='"&request("ksrq_y_date")&"' order by bh_y_id_h desc",conn,1,1