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列表...(04.24)
- 统计当月之前(不含当月)的记录...(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)

学习心得
最新文章
- 仓库管理实战课程(15)-月度库存...(04.30)
- Access选择打印机、横纵向、纸...(04.29)
- 仓库管理实战课程(14)-出库功能...(04.26)
- 通过命令按钮让Access列表框指...(04.24)
- 仓库管理实战课程(13)-入库功能...(04.21)
- Access控件美化之--美化按钮...(04.19)
- Access多行文本按指定字符筛选...(04.18)
- Microsoft Access数...(04.18)
- 仓库管理实战课程(12)-月度结存...(04.16)
- 仓库管理实战课程(11)-人性化操...(04.15)