set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select distinct a.ask_id as ask_id, e.area_id as area_id,convert(char(11), min(b.ask_date), 111) + convert(char(11), min(b.ask_date), 108) as ask_date, convert(char(11), max(b.state_date), 111) + convert(char(11), max(b.state_date), 108) as state_date,a.busi_detail_id as busi_detail_id, e.site_id as site_id,e.name as name1,d.staff_id as staff_id,d.name as name2, 0.00 as income,0.00 as deposit, a.process_flag as process_flag, serv_name, b.acc_nbr as acc_nbr, max(delieve_tache_date) as delieve_tache_date,a.serv_id as serv_id, a.order_id as order_id from serv_info_ask b,exec_order_his_A a, staff d, site e where b.ask_date between '"&start&"' and '"&finish&"' and d.site_id = e.site_id and b.ask_staff_id = d.staff_id and b.serv_id = a.serv_id and d.state='10A' and e.state='10A'group by b.serv_id having b.serv_id = a.serv_id and b.ask_staff_id = d.staff_id and d.site_id = e.site_id and b.transaction_id = max(b.transaction_id)"
rs.Open rs.Source,conn,1,1
between '"&start&"' and '"&finish&"'两个变量时间跨度一大,就会出现错误。请大家提宝贵意见