Free Lessons Courses Seminars TechHelp Fast Tips Templates Topic Index Forum ABCD

 Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon More... What's New? Popular Links ------------ Access Courses Access Index Access TechHelp Access Forum Access Troubleshooter Access Developer Network Access AI Bot ------------ Excel Courses Excel Index ------------ Code Vault Testimonials Tip Jar Advice for Consultants

 Home > TechHelp > Directory > Access > DatePart < Null Math | Parameter Query >
DatePart
By Richard Rost     2 years ago

Get Specified Part of Date. Year, Quarter, Week, etc.

S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark

In this video I will show you how to use the DatePart function to isolate specific parts of a date/time value such as the day of the year, week of the year, month, quarter, and so on. DatePart offers some options that other functions don't have.

Damon from Waterville, Ohio (a Platinum Member) asks: I have a query that shows sales for the year, but right now I have to type in the start date (say 1/1/2021) and the end date (12/31/2021) and it's a bit of a pain EVERY time I run the query. Is there any way I can simplify that to just type in the year only?

# Members

Members will learn about the FirstDayOfWeek and FirstWeekOfYear options, how to determine if a date falls within the same calendar week as the current date, and how to determine if a date falls in the same quarter of the current year.

I completely forgot to mention this in the video: the whole reason why it's handy to use the mathematical approach I showed to calculate the current quarter is because it makes it much easier to find records in the next quarter, or the previous quarter, or even use this for months. That way if you want the next quarter, and you're in the 4th quarter, you don't have to add 1 to the year and make the quarter value 1. Just use the little math trick I showed you and add 1 to that value. See how easy? I cover this in a lot more detail in the DateTime Seminar

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!

# Resources

Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted

# Keywords

microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, DatePart, parts of a date, year, quarter, month, day of year, week, week of year, weekday, week number, hour, minute, second, first week of year, first day of week, Date in current week of year, DatePart Function, How do you calculate quarters in Access, How do I extract month and year from date in Access

 Age Subject From 6 months Problem with quotes in yyyy Ester Grande

Start a NEW Conversation

Subscribe to DatePart