% set rsf = server.CreateObject("ADODB.RECORDSET") y = request("y") p_depart_dep = request("p_depart_dep") p_cli_company = request("p_cli_company") p_cli_code = request("p_cli_code") p_category = request("p_category") p_prop_date_st = request("p_prop_date_st") p_prop_date_ed = request("p_prop_date_ed") p_subject_tmp = request("p_subject_tmp") p_types1 = request("p_types1") p_types2 = request("p_types2") p_types3 = request("p_types3") today = request("today") toyear = request("toyear") s = request("s") '찾기옵션 if request("p_types1") <> "" then p_types1 = request("p_types1") else p_types1 = "0" end if if request("p_types2") <> "" then p_types2 = request("p_types2") else p_types2 = "0" end if if request("p_types3") <> "" then p_types3 = request("p_types3") else p_types3 = "0" end if if y = "1" then p_types2 = "0" p_types3 = "0" elseif y = "2" then p_types3 = "0" end if '------------------------------------------------------ '연구부서 list목록 q = "SELECT max(d_mcode) as max_code " q = q & "FROM Depart " rsc.Open q, adoConn, 1 tmp_max = rsc("max_code") rsc.Close query = "SELECT * " query = query & "FROM Depart " query = query & "WHERE d_mcode>='0' " 'query = query & " AND d_yes_no='Y' " query = query & "ORDER BY d_mcode ASC " rsc.open query, adoConn, 1 redim tmp_depart(int(tmp_max),2) for i = 1 to int(rsc.RecordCount) tmp_depart(int(rsc("d_code")),1) = rsc("d_code") tmp_depart(int(rsc("d_code")),2) = rsc("d_name") rsc.MoveNext next rsc.close '------------------------------------------------------ '조사방법 query = "select * from p_Method order by code1 " rsc.Open query, adoConn, 1 i = rsc.RecordCount redim method(i,2) i=0 method(0,0) = request("p_method") '선택된 조사방법 method(0,1) = "0" method(0,2) = "전 체" do while not rsc.EOF i = i + 1 method(i,1) = rsc("code1") method(i,2) = rsc("name1") rsc.MoveNext loop rsc.Close '------------------------------------------------------ 'category list query = "SELECT * " query = query & "FROM p_category " query = query & "ORDER BY sort_key " rsc.Open query, adoConn, 1 redim category(int(rsc.RecordCount), 2) for i = 1 to rsc.RecordCount category(i,1) = rsc("code1") category(i,2) = rsc("name1") rsc.MoveNext next rsc.Close '------------------------------------------------------ '====================================================== '검색 query 만들기 if s = "1" then '찾기 로직을 탔을 경우 '====================================================== query = "SELECT * " query = query & "FROM project2_pre " 'query = query & "WHERE p_sn <> '' " query = query & "WHERE p_delok = 'Y' " '부서-------------------------------------------------- if p_depart_dep <> "" then query = query & " AND p_depart_dep = '" & p_depart_dep & "' " end if '클라이언트명------------------------------------------ if p_cli_code <> "" then query = query & " AND p_cli_company = '" & p_cli_code & "' " end if '제안기간---------------------------------------------- if p_prop_date_st <> "" AND p_prop_date_ed <> "" then '시작 및 끝나는 날짜 구하기 if cint(right(p_prop_date_ed,2)) > 11 then edate = cstr(cint(left(p_prop_date_ed,4)) + 1) & "-01-01" else if cint(right(p_prop_date_ed,2)) > 8 then edate = cstr(left(p_prop_date_ed,4)) & "-" & cstr(cint(right(p_prop_date_ed,2)) + 1) & "-01" else edate = cstr(left(p_prop_date_ed,4)) & "-0" & cstr(cint(right(p_prop_date_ed,2)) + 1) & "-01" end if end if sdate = p_prop_date_st & "-01" edate = cdate(edate) - 1 query = query & " AND p_prop_date Between '" & sdate & "' AND '" & edate & "' " end if '------------------------------------------------------ if p_types1 <> "0" then query = query & "AND (" query = query & " p_types1 = '" & p_types1 & "' " if p_types2 <> "0" then query = query & " AND p_types2 = '" & p_types2 & "' " end if if p_types3 <> "0" then query = query & " AND p_types3 = '" & p_types3 & "' " end if query = query & ") " end if '------------------------------------------------------ query = query & "ORDER BY p_prop_date DESC, p_sn_tmp DESC " '------------------------------------------------------ tmp_search_query = query end if'if s = "1" then '====================================================== %>