实现支票日期转换为中文
时 间:2007-11-17 20:49:27
作 者:victorduane ID:70 城市:闵行
摘 要:实现支票日期转换为中文日期
正 文:
Function Date2Chinese(iDate As Date, Optional iformat As Integer) As String
Dim iYear As Integer
Dim iMonth As Integer
Dim iDay As Integer
Dim i As Integer
Dim xdate(2) As String
iYear = Year(iDate)
iMonth = Month(iDate)
iDay = Day(iDate)
For i = 1 To 4
xdate(0) = xdate(0) & Num2Char(Mid(iYear, i, 1))
Next
Debug.Print xdate(0)
xdate(1) = Num2Char(iMonth - iMonth Mod 10) & (IIf(iMonth Mod 10 = 0, "", Num2Char(iMonth Mod 10))) & "月"
Debug.Print xdate(1)
xdate(2) = Num2Char(iDay - iDay Mod 10) & (IIf(iDay Mod 10 = 0, "", Num2Char(iDay Mod 10))) & "日"
Debug.Print xdate(2)
Select Case iformat
Case 0 '年月日
Date2Chinese = xdate(0) & "年" & xdate(1) & xdate(2)
Case 1 '年
Date2Chinese = xdate(0) & "年"
Case 2 '年月
Date2Chinese = xdate(0) & "年" & xdate(1)
Case 3 '月日
Date2Chinese = xdate(1) & xdate(2)
End Select
End Function
Function Num2Char(intNum) As String
Select Case intNum
Case ""
Num2Char = ""
Case 0
Num2Char = "零"
Case 1
Num2Char = "壹"
Case 2
Num2Char = "貮"
Case 3
Num2Char = "叁"
Case 4
Num2Char = "肆"
Case 5
Num2Char = "伍"
Case 6
Num2Char = "陆"
Case 7
Num2Char = "柒"
Case 8
Num2Char = "捌"
Case 9
Num2Char = "玖"
Case 10
Num2Char = "拾"
Case 20
Num2Char = "貮拾"
Case 30
Num2Char = "叁拾"
End Select
End Function
Access软件网官方交流QQ群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 统计当月之前(不含当月)的记录...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- 【Access Inputbo...(12.23)
- 【Access Dsum示例】...(12.16)

学习心得
最新文章
- 仓库管理实战课程(9)-开发往来单...(04.02)
- 仓库管理实战课程(8)-商品信息功...(04.01)
- 仓库管理实战课程(7)-链接表(03.31)
- 仓库管理实战课程(6)-创建查询(03.29)
- 仓库管理实战课程(5)-字段属性(03.27)
- 设备装配出入库管理系统;基于Acc...(03.24)
- 仓库管理实战课程(4)-建表操作(03.22)
- 仓库管理实战课程(3)-需求设计说...(03.19)
- 仓库管理实战课程(2)-软件背景和...(03.18)
- 仓库管理实战课程(1)-讲师介绍(03.16)