We help IT Professionals succeed at work.

Access Query - calculate End of the Month in Query

spiga83
spiga83 asked
on
298 Views
Last Modified: 2018-01-17
Can anybody tell me why this formula does not work for a certain month?
I am struggling finding a solution, please help.

EOM: DateAdd("m",1,DateSerial(Year([DateX]),Month([DateX]),1)-1)

DateX                  EOM
1/1/2017      1/31/2017
2/1/2017      2/28/2017
3/1/2017      3/28/2017
4/1/2017      4/30/2017
5/1/2017      5/30/2017
6/1/2017      6/30/2017
7/1/2017      7/30/2017
8/1/2017      8/31/2017
9/1/2017      9/30/2017
10/1/2017      10/30/2017
11/1/2017      11/30/2017
12/1/2017      12/30/2017
Comment
Watch Question

Author

Commented:
found a solution..
EOM: DateAdd("m",1,DateSerial(Year([DateX]),Month([DateX]),1))-1

-1 needed to be in a different position... hope this could be helpful for someone else...
Remote Training and Programming
CERTIFIED EXPERT
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.