Solved

Coding first and last day of current month in Access

Posted on 2014-10-18
3
7,137 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
ID: 40389365
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
ID: 40389368
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
ID: 40389470
Check this link for displaying specific dates.
http://support.microsoft.com/kb/210604
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

860 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