支票大写日期

 

 

某某年:都大写,如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 ()函数转换;

 

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

 


 

阅读更多
换一批

[原创分享]支票日期大写转换

06-04

[code=VB]Clearrn?Date2Chinese(^2010-6-4,"yyyymmdd")rn?Date2Chinese(^2009-01-15,"yyyymmdd")rn?Date2Chinese(^2009-10-20,"yyyymmdd")rnrnrn*!* ====================================================rn*!* 作 用:支票日期大写转换rn*!* 语 法:Date2Chinese(d日期,c输出格式)rn*!* 参数说明:d日期:日期型日期格式,如 2010/06/04或 2010-6-4; c输出格式:字符型,yyyymmdd输出年月日,mm输出月,dd输出日rn*!* 返 回 值:字符型rn*!* 作 者:十豆三,感谢网友 dragon_zone(本函数通过参考dragon_zone的代码后优化而来)rn*!* 参考网页:http://hi.baidu.com/dragon_zone/blog/item/6ee6a544edd36383b3b7dc40.htmlrn*!* ====================================================rnFunction Date2Chinese(tdDate,tcFormat)rn * 票据的出票日期必须使用中文大写。为防止变造票据的出票日期;rn * 在填写月、日时,月为壹、贰和壹拾的,日为壹至玖和壹拾、贰拾和叁拾的,应在其前加“零”;rn * 日为拾壹至拾玖的,应在其前加“壹”。如1月15日,应写成零壹月壹拾伍日。再如10月20日,应写成零壹拾月零贰拾日。rn Local num(10),lnYear,lnMonth,lnDay,lcYear,lcMonth,lcDayrn num(1)="零"rn num(2)="壹"rn num(3)="贰"rn num(4)="叁"rn num(5)="肆"rn num(6)="伍"rn num(7)="陆"rn num(8)="柒"rn num(9)="捌"rn num(10)="玖"rnrn lnYear=Year(tdDate)rn lnMonth=Month(tdDate)rn lnDay=Day(tdDate)rnrn *转换年rn lcYear=num(lnYear/1000+1)+num(Mod(lnYear/100,10)+1)+num(Mod(lnYear/10,10)+1)+num(Mod(lnYear,10)+1)rnrnrn *转换月rn If lnMonth>=10rn If lnMonth=10rn lcMonth="零壹拾"rn Elsern lcMonth="壹拾"+num(Mod(lnMonth,10)+1)rn Endifrn Elsern If lnMonth=1 Or lnMonth=2rn lcMonth="零"+num(Mod(lnMonth,10)+1)rn Elsern lcMonth=num(Mod(lnMonth,10)+1)rn Endifrn Endifrnrn *转换日rn If lnDay>=10rn If lnDay=10 Or lnDay=20 Or lnDay=30rn lcDay="零"+num(lnDay/10+1)+"拾"rn Elsern lcDay=num(lnDay/10+1)+"拾"+num(Mod(lnDay,10)+1)rn Endifrn Elsern lcDay="零"+num(Mod(lnDay,10)+1)rn Endifrnrn Do Casern Case tcFormat="yyyymmdd"rn Date2Chinese=lcYear+"年"+lcMonth+"月"+lcDay+"日"rn Case tcFormat="yyyy"rn Date2Chinese=lcYearrn Case tcFormat="mm"rn Date2Chinese=lcMonthrn Case tcFormat="dd"rn Date2Chinese=lcDayrn Endcasernrn Return Date2ChinesernEndfunc[/code]

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