Files
KIN/project/project_code_reg_ajax_2014.asp
2025-09-29 17:55:08 +09:00

33 lines
1.2 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=rsc></OBJECT>
<%'
'p_sn만들기
query = "SELECT top 1 p_sn "
query = query & "FROM T_PROJECT_BASE "
query = query & "WHERE substring(p_sn, 0, 5) = '" & right("0" & year(date()), 2) & right("0" & month(date()), 2) & "' "
query = query & " AND substring(p_sn, 5, 3) <> '000' "
query = query & " AND substring(p_sn, 8, 1) <> '_' " '서브 프로젝트가 상위로 올라오는 것을 막음
query = query & "ORDER BY sn DESC, p_sn DESC "
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
if instr(1, rsc("p_sn"), "_") then
p_sn = right("0" & year(date()), 2) & right("0" & month(date()), 2) & right("000" & int(left(right(rsc("p_sn"), 5), 3)) + 1, 3)
else
p_sn = right("0" & year(date()), 2) & right("0" & month(date()), 2) & right("000" & int(right(rsc("p_sn"), 3)) + 1, 3)
end if
else
p_sn = right("0" & year(date()), 2) & right("0" & month(date()), 2) & "001"
end if
rsc.Close
Response.CharSet = "EUC-KR" '한글
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-control", "no-staff"
Response.Expires = -1
response.write p_sn
%>