iEhohs DokuWiki

よく使いそうなネタをまとめておく個人的ナレッジです。

ユーザ用ツール

サイト用ツール


access:firstday-lastday-of-month

月の1日と最終日を取得する

1日

=DateSerial(Year(Date()), Month(Date()), 1)

最終日

=DateAdd("d",-1,DateSerial(Year(Date()), Month(Date())+1, 1))

フォーム上で期間抽出する場合

テーブルの「日付」フィールドに対するフィルターです。

Me.Filter = "日付 >= #" & DateSerial(Year(Date()), Month(Date()), 1) & "# and 日付 <= #" & DateAdd("d",-1,DateSerial(Year(Date()), Month(Date())+1, 1)) & "#"
access/firstday-lastday-of-month.txt · 最終更新: by shimehitsu14