access大写日期的函数
时 间:2009-02-09 08:40:53
作 者:郑家龙 ID:90 城市:上海
摘 要:大写日期的函数
正 文:
Public Function Dochangedate(strDate)
strDate = Format(strDate, "yy-mm-dd")
If Mid(strDate, 8, 1) = "0" Then
Select Case Mid(strDate, 7, 2)
Case 10
Dochangedate = "零一十"
Case 20
Dochangedate = "零二十"
Case 30
Dochangedate = "零三十"
End Select
Else
Select Case Mid(strDate, 8, 1)
Case 1
variable1 = "一"
Case 2
variable1 = "二"
Case 3
variable1 = "三"
Case 4
variable1 = "四"
Case 5
variable1 = "五"
Case 6
variable1 = "六"
Case 7
variable1 = "七"
Case 8
variable1 = "八"
Case 9
variable1 = "九"
End Select
Select Case Mid(strDate, 7, 1)
Case 0
variable2 = "零"
Case 1
variable2 = "一十"
Case 2
variable2 = "二十"
Case 3
variable2 = "三十"
End Select
Dochangedate = variable2 & variable1
End If
End Function
Public Function Dochangemonth(strMonth)
strMonth = Format(strMonth, "yy-mm-dd")
If Mid(strMonth, 4, 1) = "0" Then
Select Case Mid(strMonth, 5, 1)
Case 1
Dochangemonth = "零一"
Case 2
Dochangemonth = "零二"
Case 3
Dochangemonth = "零三"
Case 4
Dochangemonth = "四"
Case 5
Dochangemonth = "五"
Case 6
Dochangemonth = "六"
Case 7
Dochangemonth = "七"
Case 8
Dochangemonth = "八"
Case 9
Dochangemonth = "九"
End Select
Else
Select Case Mid(strMonth, 5, 1)
Case 0
Dochangemonth = "零一十"
Case 1
Dochangemonth = "一十一"
Case 2
Dochangemonth = "一十二"
End Select
End If
End Function
Public Function Dochangeyear(strYear)
strYear = Format(strYear, "yy-mm-dd")
Select Case Mid(strYear, 2, 1)
Case 0
variable1 = "零"
Case 1
variable1 = "一"
Case 2
variable1 = "二"
Case 3
variable1 = "三"
Case 4
variable1 = "四"
Case 5
variable1 = "五"
Case 6
variable1 = "六"
Case 7
variable1 = "七"
Case 8
variable1 = "八"
Case 9
variable1 = "九"
End Select
Select Case Mid(strYear, 1, 1)
Case 0
variable2 = "零"
Case 1
variable2 = "一"
Case 2
variable2 = "二"
Case 3
variable2 = "三"
Case 4
variable2 = "四"
Case 5
variable2 = "五"
Case 6
variable2 = "六"
Case 7
variable2 = "七"
Case 8
variable2 = "八"
Case 9
variable2 = "九"
End Select
Dochangeyear = variable2 & variable1
End Function
Public Function Dochangeyear1(strYear)
strYear = Format(strYear, "yy-mm-dd")
Select Case Mid(strYear, 2, 1)
Case 0
variable1 = "零"
Case 1
variable1 = "一"
Case 2
variable1 = "二"
Case 3
variable1 = "三"
Case 4
variable1 = "四"
Case 5
variable1 = "五"
Case 6
variable1 = "六"
Case 7
variable1 = "七"
Case 8
variable1 = "八"
Case 9
variable1 = "九"
End Select
Select Case Mid(strYear, 1, 1)
Case 0
variable2 = "零"
Case 1
variable2 = "一"
Case 2
variable2 = "二"
Case 3
variable2 = "三"
Case 4
variable2 = "四"
Case 5
variable2 = "五"
Case 6
variable2 = "六"
Case 7
variable2 = "七"
Case 8
variable2 = "八"
Case 9
variable2 = "九"
End Select
Dochangeyear1 = "二零" & variable2 & variable1
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)