|
请参见如下示例:
Function GetDateList(ByVal y As Long, ByVal m As Long) As String
Dim str As String
Dim ssql As String
Dim i As Long
Dim d0 As Date
Dim d1 As Date
ssql = "select * from 数据表 where year(日期)=" & y & " and month(日期)=" & m
Me.数据表.RowSource = ssql
If Year(Date) = y And Month(Date) = m Then
d1 = Date
Else
d1 = DateSerial(y, m + 1, 0)
End If
str = ""
d0 = DateSerial(y, m, 1)
Do While d0 <= d1
If DCount("*", "数据表", "日期=#" & d0 & "#") = 0 Then
str = str & d0 & ";"
End If
d0 = DateAdd("d", 1, d0)
Loop
str = Left(str, Len(str) - 1)
GetDateList = str
End Function
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|