Click here to Skip to main content
15,886,056 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
I am using MS Acess I want to use DateAdd function for fetching the date column with which will select with next month date

Ex If I have 20/1/2015 after selection it will give as 20/2/2015

select employee.emp_id, DateAdd("mm",1, employee.join_date) as val from employee

which will giving value as

empid val
1 #Error
2 #Error

please help me
Posted
Updated 22-Feb-15 20:02pm
v2

No problem, have a look here: DateAdd function (MS Access)[^]

Usage:
SQL
SELECT DateAdd ("m", 1, #20/01/2015#) AS NewDate


Note: You should use ISO format for date: mm/dd/yyyy if you want to get correct output ;)
 
Share this answer
 
Comments
Member 11396810 23-Feb-15 2:33am    
Sir Thanks for the solution

Is it possible to put DateAdd ("m", 1, #20/01/2015#) in where condition
Maciej Los 23-Feb-15 2:35am    
To find out, you need to try ;)
Member 11396810 23-Feb-15 3:09am    
Yes Sir Its works Thank For Your Suggestions :)
Maciej Los 23-Feb-15 3:51am    
You're very welcome ;)
SELECT employee.emp_id, DateAdd ("m", 1, employee.join_date) AS NewDate from employee

this will working sir Thank you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900