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.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)
- 微软Access邀测新Monaco...(11.12)
- Access列表框左右互选、列表框...(11.11)
- 高效率在导入数据前删除记录(11.10)
- Access报价单转订单示例代码(11.08)
- Access系统自带的日期选择器不...(11.08)
- 分享一下Access工程中的acw...(11.07)