<%
Function GetLastApprovalDate(target100)
Dim arr, i, result
result = ""
If target100 <> "" Then
arr = Split(target100, "^^")
For i = UBound(arr) To 0 Step -1
If Trim(arr(i)) <> "" And Trim(arr(i)) <> "/" Then
result = Trim(arr(i))
Exit For
End If
Next
End If
GetLastApprovalDate = result
End Function
sql=""&VbCrlf
sql=sql&" SELECT M.p_sn, p.p_subject, VD.T_name AS dept_name, p_method_cd, d_write_name AS p_name, d_write_date, "&VbCrlf
sql=sql&" target3 AS o_child_cost, target1 AS c_child_cost, "&VbCrlf
sql=sql&" target4 AS o_cost, target5 AS c_cost, "&VbCrlf
sql=sql&" target2 AS reason, target100 "&VbCrlf
sql=sql&" FROM 문서내용 M LEFT JOIN Document D ON M.문서번호 = D.d_no "&VbCrlf
sql=sql&" LEFT JOIN T_PROJECT_METHOD P ON M.p_sn = P.p_child_sn "&VbCrlf
sql=sql&" LEFT JOIN T_PROJECT_BASE TPB ON P.p_sn = TPB.p_sn "&VbCrlf
sql=sql&" LEFT JOIN V_Department VD ON ((ISNULL(TPB.p_depart_dep, '') = '0' AND ISNULL(TPB.p_Depart_N, '') = 'E' AND ISNULL(TPB.p_Team_N, '') = '101' AND P.p_rsch_dept = VD.before_t_cd1) OR (NOT (ISNULL(TPB.p_depart_dep, '') = '0' AND ISNULL(TPB.p_Depart_N, '') = 'E' AND ISNULL(TPB.p_Team_N, '') = '101') AND (((ISNULL(TPB.p_Depart_N, '') + ISNULL(TPB.p_Team_N, '')) <> '' AND (ISNULL(TPB.p_Depart_N, '') + ISNULL(TPB.p_Team_N, '')) = VD.Code) OR ((ISNULL(TPB.p_Depart_N, '') + ISNULL(TPB.p_Team_N, '')) = '' AND TPB.p_depart_dep = VD.before_t_cd1)))) "&VbCrlf
sql=sql&" WHERE 문서제목 = '프로젝트계약액수정' "&VbCrlf
sql=sql&" AND d_order_cnt = '77' AND del_yes_no = 'no' "&VbCrlf
sql=sql&" AND d_write_date >= CONVERT(varchar(10), DATEADD(MONTH, -3, getdate()), 120) "&VbCrlf
sql=sql&" ORDER BY d_write_date DESC "&VbCrlf
Rs.Open sql, adoConn, 1
While Not Rs.Eof
%>
| ','<%=mid(Rs("p_sn"),9,1)%>','<%=Rs("p_method_cd")%>','<%=Rs("p_sn")%>');"><%=Rs("p_sn")%> |
','<%=mid(Rs("p_sn"),9,1)%>','<%=Rs("p_method_cd")%>','<%=Rs("p_sn")%>');"><%=Rs("p_subject")%> |
<%=GetLastApprovalDate(Rs("target100"))%> |
<%=Rs("dept_name")%> |
<%=Rs("p_name")%> |
<%=Rs("d_write_date")%> |
<%if Rs("o_child_cost") <> Rs("c_child_cost") then %><%=formatnumber(Rs("o_child_cost"), 0)%><% end if %> |
<%if Rs("o_child_cost") <> Rs("c_child_cost") then %><%=formatnumber(Rs("c_child_cost"), 0)%><% end if %> |
<%if Rs("o_cost") <> Rs("c_cost") then %><%=formatnumber(Rs("o_cost"), 0)%><% end if %> |
<%if Rs("o_cost") <> Rs("c_cost") then %><%=formatnumber(Rs("c_cost"), 0)%><% end if %> |
<%=Rs("reason")%> |
<%
Rs.movenext
Wend
Rs.Close
%>