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)
- Access对子窗体数据进行批...(10.30)
- 最精简的组合框行来源数据快速输...(10.25)
- Access仿平台的多值选择器...(10.24)
- 【Access日期区间段查询】...(10.22)
- 【Access源码示例】VBA...(10.12)
- Access累乘示例,Acce...(10.09)
- 数值8.88,把整数8去掉,转...(10.08)
- 【Access自定义函数】一个...(09.30)
- 【Access选项卡示例】Ac...(09.09)
学习心得
最新文章
- Access判断多条明细的配方或订...(11.30)
- 如何让后台数据库在局域网共享时,且...(11.29)
- 【Access月初月末日期设置方法...(11.29)
- 【Access IIF函数嵌套示例...(11.26)
- Access快速开发平台--使用组...(11.25)
- Access快速开发平台--对上传...(11.22)
- Access快速开发平台企业版--...(11.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)