日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

統(tǒng)計(jì)某個(gè)日期區(qū)間內(nèi)星期天的個(gè)數(shù)_Access數(shù)據(jù)庫(kù)教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

推薦:淺析通用刪除某表某字段滿(mǎn)足條件的記錄兩個(gè)函數(shù)
一、調(diào)用方式: Sub Acchelp_Test() '如果是條件是長(zhǎng)整型 Call AccHelp_DeleteFldNumRow(表名稱(chēng), 字段名稱(chēng), 條件) '如果是條件是文本型 'Call AccHelp_DeleteFldStrRow(表名稱(chēng), 字段名稱(chēng), 條件) End Sub 二、兩個(gè)函數(shù): Public Function AccHelp_Del

文章正文:
'功能:算出某個(gè)日期區(qū)間內(nèi)星期天的個(gè)數(shù)
'作者:竹笛
'修改歷史:2005/12/30
'未經(jīng)嚴(yán)格測(cè)試,有問(wèn)題請(qǐng)與作者交流

Function SundayCount(StartDate As Date, EndDate As Date) As Long
On Error GoTo Err_SundayCount:
Dim Days As Integer '區(qū)間天數(shù)
Dim FirstSunday As Date '第一個(gè)周日具體日期
Dim NextSunday As Date '下一個(gè)周日具體日期
Dim Myweekday As Integer
Dim i As Long
Dim j As Long
'確保日期都不為空,若為空則置為0
If Not IsNull(StartDate) And Not IsNull(EndDate) Then
'如果結(jié)束日期<開(kāi)始日期,則為0
If EndDate >= StartDate Then
'如果天數(shù)大于7,則先確定第一個(gè)周日是哪個(gè)日期,再7天一加,直到大于結(jié)束日期
Days = EndDate - StartDate
' If Days > 7 Then
Myweekday = Weekday(StartDate) '算出是周幾,星期天是1
If Myweekday > 1 Then
FirstSunday = StartDate + 8 - Myweekday
Else
FirstSunday = StartDate
End If
Debug.Print "最近的周日是: " & FirstSunday
NextSunday = FirstSunday + 7
i = 1
SundayCount = 1
For i = 1 To Days Step 7
Debug.Print "下一個(gè)周日是: " & NextSunday
If NextSunday > EndDate Then
If FirstSunday > EndDate Then
SundayCount = SundayCount - 1
End If
Debug.Print "周日數(shù)目是: " & SundayCount
Exit Function
End If
NextSunday = NextSunday + 7
i = i + 1
SundayCount = SundayCount + 1
Debug.Print "周日數(shù)目是: " & SundayCount
Next
Else
SundayCount = 0
End If
Else
SundayCount = 0
End If
Exit_SundayCount:
Exit Function
Err_SundayCount:
SundayCount = 0
Resume Exit_SundayCount
End Function

Sub Test()
Debug.Print SundayCount(#2/6/2005#, #2/25/2005#)
End Sub

 

分享:揭秘在設(shè)計(jì)視圖中Access允許的九種數(shù)據(jù)類(lèi)型
在表的設(shè)計(jì)視圖中,每一個(gè)字段都有設(shè)計(jì)類(lèi)型,Access允許九種數(shù)據(jù)類(lèi)型:文本、備注、數(shù)值、日期/時(shí)間、貨幣、自動(dòng)編號(hào)、是/否、OLE對(duì)象、超級(jí)鏈接、查詢(xún)向?qū)А?文本:這種類(lèi)型允許最大255個(gè)字符或數(shù)字,Access默認(rèn)的大小是50個(gè)字符,而且系統(tǒng)只保存輸入到字段

來(lái)源:模板無(wú)憂(yōu)//所屬分類(lèi):Access數(shù)據(jù)庫(kù)教程/更新時(shí)間:2010-03-21
相關(guān)Access數(shù)據(jù)庫(kù)教程