Solved

Coding first and last day of current month in Access

Posted on 2014-10-18
3
5,357 Views
Last Modified: 2014-10-18
Experts,

Is there a way to code first day of current month and first day of next month in an SQL query in Access.  I want to do this so the query does not have to change and can be run automatically each month.
0
Comment
Question by:morinia
3 Comments
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
Comment Utility
DateSerial(Year(Date()),Month(Date()),1)

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

Jim.
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 300 total points
Comment Utility
Use the DateSerial Function.  Here are some examples:
FirstDayOfMonth: DateSerial(Year(Date()), Month(Date()), 1)
LastDayOfMonth: DateSerial(Year(Date()), Month(Date())+1, 0)
FirstDayOfNextMonth: DateSerial(Year(Date()), Month(Date())+1, 1)

Ron
0
 
LVL 30

Expert Comment

by:hnasr
Comment Utility
Check this link for displaying specific dates.
http://support.microsoft.com/kb/210604
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now