260521_02_ENH: 사전답사 pkey 변경 및 투표소 코드 관련된 정리

This commit is contained in:
2026-05-21 12:26:18 +09:00
parent ed52d4cdfd
commit 09893c6b3a
3 changed files with 36 additions and 32 deletions

View File

@@ -59,7 +59,11 @@ case "code"
SQL = " select gubun, r_cd, r_nm, Flag from exitpoll.dbo.R_code where Flag = '1' and gubun = '" & sel_code & "' "
if sel_code = "district" Then
SQL = SQL & " and left(r_cd,2) = '" & Request("area_cd") & "' "
if LEN(Request("area_cd")) > 2 then
SQL = SQL & " and len(r_cd) > 4 and left(r_cd,4) = '" & Request("area_cd") & "' "
else
SQL = SQL & " and len(r_cd) < 5 and left(r_cd,2) = '" & Request("area_cd") & "' "
end if
End If
Objdb.Open SQL,DBConn,3,1,1
if not Objdb.eof Then

View File

@@ -9,7 +9,7 @@ SQL = ""
SQL = SQL&" SELECT 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) AS pcode "
SQL = SQL&" FROM exitpoll.dbo.POLL_EXP_LOGIN Q CROSS APPLY STRING_SPLIT(MATCHING,',') AS D "
SQL = SQL&" inner join kon.dbo.DATA DA on Q.PKEY = DA.PKEY and DA.IDKEY = 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) "
SQL = SQL&" WHERE Q.PKEY = '2504025_A' AND D.VALUE = '"&Exit_cd&"' and DA.status = '10' "
SQL = SQL&" WHERE Q.PKEY = '2604001_A' AND D.VALUE = '"&Exit_cd&"' and DA.status = '10' "
Objdb.Open SQL,DBConn,3,1,1
If not Objdb.eof then
%>