支票大写日期

 

 

某某年:都大写,如2007年,写作:贰零零柒
1月到10月:前面加零,比如10月,写作 :零壹拾
11、12月:壹拾壹 ,壹拾贰
1-10日:零壹 ……零壹拾
20、30日:零贰拾,零叁拾
11-19,21-29,31:壹拾壹……壹拾玖;贰拾壹……贰拾玖;叁拾壹


七、票据的出票日期必须使用中文大写。为防止变造票据的出票日期,在填写月、日时,月为壹、贰和壹拾的,日为壹至玖和壹拾、贰拾和叁拾的,应在其前加“零”;日为拾壹至拾玖的,应在其前加“壹”。如1月15日,应写成零壹月壹拾伍日。再如10月20日,应写成零壹拾月零贰拾日。

《支付结算办法》是商业银行的指导性文件,银行必须遵守。你可以据此要求银行受理你的票据,否则可以向当地银监投诉。

 

 

用水晶报表做的现金支票套打。将标准格式的日期"2009-09-09"转换为大写的日期,我是如下处理的

 

定义了两个函数

 

Function ToUDate (str1 As String)

    if str1<>"" then

        dim allStr
        allStr = Split(str1,"-")

        dim Part1 As String
        dim Part2 As String
        dim Part3 As String

        Part1 = allStr(1)
        Part2 = allStr(2)
        Part3 = allStr(3)

        dim temp1 As String
        dim temp2 As String
        dim l As Number

        l = len(Part1)
        While l>0
            temp1 = Left(Part1,1)
            temp2 = temp2 + NumberToChar(temp1)
            if l>1 then
                Part1 = Right(Part1,l-1)
            end if
            l = l-1
        Wend

        temp2 = temp2 + "   " + NumberToChar(Part2)
        temp2 = temp2 + "   " + NumberToChar(Part3)

        ToUDate = temp2

    else
        ToUDate = ""
    end if


End Function

 

 

Function NumberToChar (strNum as string)
    Select Case strNum
        Case "1"
            NumberToChar = "壹"
        Case "2"
            NumberToChar = "贰"
        Case "3"
            NumberToChar = "叁"
        Case "4"
            NumberToChar = "肆"
        Case "5"
            NumberToChar = "伍"
        Case "6"
            NumberToChar = "陆"
        Case "7"
            NumberToChar = "柒"
        Case "8"
            NumberToChar = "捌"
        Case "9"
            NumberToChar = "玖"
        Case "0"
            NumberToChar = "零"
        Case "01"
            NumberToChar = "零壹"
        Case "02"
            NumberToChar = "零贰"
        Case "03"
            NumberToChar = "零叁"
        Case "04"
            NumberToChar = "零肆"
        Case "05"
            NumberToChar = "零伍"
        Case "06"
            NumberToChar = "零陆"
        Case "07"
            NumberToChar = "零柒"
        Case "08"
            NumberToChar = "零捌"
        Case "09"
            NumberToChar = "零玖"
        Case "10"
            NumberToChar = "零壹拾"
        Case "11"
            NumberToChar = "壹拾壹"
        Case "12"
            NumberToChar = "壹拾贰"
        Case "13"
            NumberToChar = "壹拾叁"
        Case "14"
            NumberToChar = "壹拾肆"
        Case "15"
            NumberToChar = "壹拾伍"
        Case "16"
            NumberToChar = "壹拾陆"
        Case "17"
            NumberToChar = "壹拾柒"
        Case "18"
            NumberToChar = "壹拾捌"
        Case "19"
            NumberToChar = "壹拾玖"
        Case "20"
            NumberToChar = "零贰拾"
        Case "21"
            NumberToChar = "贰拾壹"
        Case "22"
            NumberToChar = "贰拾贰"
        Case "23"
            NumberToChar = "贰拾叁"
        Case "24"
            NumberToChar = "贰拾肆"
        Case "25"
            NumberToChar = "贰拾伍"
        Case "26"
            NumberToChar = "贰拾陆"
        Case "27"
            NumberToChar = "贰拾柒"
        Case "28"
            NumberToChar = "贰拾捌"
        Case "29"
            NumberToChar = "贰拾玖"
        Case "30"
            NumberToChar = "零叁拾"
        Case "31"
            NumberToChar = "叁拾壹"
        Case "-"
            NumberToChar = "   "
        Case Else
            NumberToChar = ""
    End Select
End Function

 

 

将日期作为参数传进来后,在报表中调用ToUDate ()函数转换;

 

自己看着上面的代码都感慨自己好懒哦 !

 


 

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页