-
2
- #1
tlbroadbent
MIS
faq705-3277 has been added to the Access Modules (VBA Coding) forum. It lists several online resources that explain how to use date/time functions in Access. Many of the web pages contain code examples such as the following from
The first day of the previous month:
DateSerial(Year(Date()), Month(Date())-1,1)
The first day of the current quarter:
DateSerial(Year(Date()), Int((Month(Date()) - 1) / 3) * 3 + 1, 1)
The first day of the current week (assuming Sunday = day 1):
Date() - WeekDay(Date()) + 1
Two links in the FAQ are to downloadable databases that demonstrate many Access functions, methods and techniques, including some of the functions contained in the linked date/time resources.
I've also linked to existing date/time FAQs in the Access forums. If I missed any, please let me know.
If you want to get the best answer for your question read faq183-874 and thread183-468158.
Terry L. Broadbent - DBA
SQL Server Page:
The first day of the previous month:
DateSerial(Year(Date()), Month(Date())-1,1)
The first day of the current quarter:
DateSerial(Year(Date()), Int((Month(Date()) - 1) / 3) * 3 + 1, 1)
The first day of the current week (assuming Sunday = day 1):
Date() - WeekDay(Date()) + 1
Two links in the FAQ are to downloadable databases that demonstrate many Access functions, methods and techniques, including some of the functions contained in the linked date/time resources.
I've also linked to existing date/time FAQs in the Access forums. If I missed any, please let me know.
If you want to get the best answer for your question read faq183-874 and thread183-468158.
Terry L. Broadbent - DBA
SQL Server Page: