% v_mid = InputValue(request("p_mid")) v_yy = InputValue(request("p_yy")) v_mm = InputValue(request("p_mm")) v_type = InputValue(request("p_type")) If v_yy="" then v_yy = year(now) If v_mm="" then v_mm = month(now) v_mm = Right("00"&v_mm,2) If v_type="" then v_type = "day" Dim arrValue() Dim arrValue_mms() dataLength = 0 totalCount = 0 totalCount_mms = 0 If v_mid<>"" then If v_type="day" Then temp_d = DateAdd("m",1, v_yy&"-"&v_mm&"-01") dataLength = Right(DateAdd("d", -1, temp_d ),2) ReDim arrValue(dataLength) ReDim arrValue_mms(dataLength) tablename = "em_log_"&v_yy&v_mm sql = " SELECT day(tran_date), count(*) FROM "&tablename&" WHERE tran_id='"&v_mid&"' GROUP BY day(tran_date) " Set rs = dbcon.execute(sql) Do While Not rs.eof arrValue(rs(0)) = rs(1) totalCount = totalCount + CInt(rs(1)) rs.movenext Loop rs.close : Set rs = Nothing '-----------mms 카운트--------------- tablename = "sdk_mms_report_detail_" & Right(v_yy,2) & v_mm '//table 존재유무 sql = "select count(*) as cnt from information_schema.tables where table_name = '" & tablename & "'" 'Response.write sql Set rs = dbcon.execute( sql ) rscount = rs("cnt") rs.close : Set rs = Nothing If rscount > 0 Then sql = " SELECT right(left(send_date,8), 2), count(*) FROM "&tablename&" WHERE user_id='"&v_mid&"' GROUP BY right(left(send_date,8), 2) " Set rs = dbcon.execute(sql) Do While Not rs.eof arrValue_mms(rs(0)) = rs(1) totalCount_mms = totalCount_mms + CInt(rs(1)) rs.movenext Loop rs.close : Set rs = Nothing End if '-----------mms 카운트끝--------------- Else dataLength = 12 ReDim arrValue(dataLength) ReDim arrValue_mms(dataLength) For i=1 To 12 tablename = "em_log_" & v_yy & Right("00"&i,2) '//table 존재유무 sql = "select count(*) as cnt from information_schema.tables where table_name = '" & tablename & "'" Set rs = dbcon.execute( sql ) rscount = rs("cnt") rs.close : Set rs = Nothing If rscount > 0 Then sql = " SELECT count(*) FROM "&tablename&" WHERE tran_id='"&v_mid&"'" Set rs = dbcon.execute( sql ) arrValue(i) = rs(0) totalCount = totalCount + CInt(rs(0)) End If '-----------mms 카운트--------------- tablename = "sdk_mms_report_detail_" & Right(v_yy,2) & Right("00"&i,2) '//table 존재유무 sql = "select count(*) as cnt from information_schema.tables where table_name = '" & tablename & "'" 'Response.write sql Set rs = dbcon.execute( sql ) rscount = rs("cnt") rs.close : Set rs = Nothing If rscount > 0 Then sql = " SELECT count(*) FROM "&tablename&" WHERE user_id='"&v_mid&"'" Set rs = dbcon.execute( sql ) arrValue_mms(i) = rs(0) If arrValue_mms(i) = 0 Then arrValue_mms(i) = "" totalCount_mms = totalCount_mms + CInt(rs(0)) End if '-----------mms 카운트끝--------------- next End If End if %>