# Thread: Need help to create a date that is more than 30 days from another date

1. Registered User
Join Date
Sep 2008
Posts
150

## Answered: Need help to create a date that is more than 30 days from another date

Hello,

How can I create a formula in an Access (2010) query grid to see dates in field 1 that is more than 30 days from field 2?

Field 1 = Start date
Field 2 = Install date

Ex: Start date>30 days from Install date

## " Code: `Difference: DateDiff("d",[Start Date] + 30 ,[Install Date])` Does this work?"

Join Date
Feb 2004
Location
New Zealand
Posts
1,472

4. Registered User
Join Date
Sep 2008
Posts
150
Originally Posted by myle
Hi Myle,

I tried the DateAdd, but I don't think that is what I need. I tested with this formula.

This formula adds 30 days to Start Date.

I need to get the number of days over 30 days from Install Date.

So, if Start Date is 3/1/15 and Install date is 4/15/15, how can I output the number of days past 30 days, which would be 16 days over. I would like to output the 16 days in the 30 Day Test column. :-)

5. Registered User
Join Date
May 2005
Location
Posts
2,888
The DateDiff() function would return the number of days between the 2 fields.

6. Registered User
Join Date
Oct 2014
Posts
291
Code:
`Difference: DateDiff("d",[Start Date] + 30 ,[Install Date])`
Does this work?
Last edited by VLOOKUP; 04-22-15 at 11:25.

7. Registered User
Join Date
Sep 2008
Posts
150
Originally Posted by VLOOKUP
Code:
`Difference: DateDiff("d",[Start Date] + 30 ,[Install Date])`
Does this work?

YES! It worked! Thank you so much.

Do you know how I can get rid of the "-" numbers and just convert to whole numbers? For example, I would like to convert -17 to just 17.

8. Registered User
Join Date
May 2005
Location
Posts
2,888
Check out the Int() and Fix() functions.

9. Registered User
Join Date
Oct 2014
Posts
291
Code:
`Difference: Abs(DateDiff("d",[Start Date]+30,[Install Date]))`
That should take of the negative values.

You are welcome BTW

Just looking to get better at Access myself!

HTH

10. Registered User
Join Date
May 2005
Location
Posts
2,888

11. Registered User
Join Date
Sep 2008
Posts
150
Originally Posted by VLOOKUP
Code:
`Difference: Abs(DateDiff("d",[Start Date]+30,[Install Date]))`
That should take of the negative values.

You are welcome BTW

Just looking to get better at Access myself!

HTH
Thank you HTH and pbaldy for your recommendations and samples. I will try the "Abs(DateDiff("d",[Start Date]+30,[Install Date]))" function when I get back to work. Again, I appreciate all of your help. :-)

12. Registered User
Join Date
Sep 2008
Posts
150
Woo hoo! The Abs(DateDiff WORKED GREAT!

Thanks for helping with my stress level. :-D

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•