Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Dim dt1 As Date dt1 = Date MsgBox dt1 ' works - 12.10.2012 Day(dt1) = 1 ' error: object required
2012年1月10日が必要です。 したがって、どの日付でも、dt1をその特定の日付の最初の日として設定する必要があります。
dateserialを使用して日付を再構築できます
例えば
newDate = DateSerial(Year(dt1), Month(dt1), 1)
日数を直接差し引くこともできます
dt1 = dt1 - Day(dt1) + 1