마지막 달의 날자를 구하는 함수 입니다..

Function getTotalMonthDay( strMonth, strYear)
    Dim result = 0

    select case strMonth
    case "1" ,"3", "5", "7", "8", "10", "12"
        result = 31
    case "4", "6", "9", "11"
        result = 30
    case "2"
        if ((strYear mod 4) = 0 and (strYear mod 100) <> 0) or (strYear mod 400) = 0 then
            result = 29
        else
            result = 28
        end if
    end select

     getTotalMonthDay= result

End Function

+ Recent posts