?
Solved

Coding first and last day of current month in Access

Posted on 2014-10-18
3
Medium Priority
?
9,656 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 800 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 1200 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

770 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