Jump to content
Server Maintenance This Week. ×

Date Calculation


monfa9

This topic is 8667 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Again, since I'm a beginner I'm still having a hard time getting some points; bear with me :

I'm trying to do a simple calculation where if the "enter date" field is between the 1st and the 15th the "display date" field reads 8/15/00 for example. And if the "enter date field" is after the 16th then the display date should reade 8/31/00. I also have a "date override" field where any date I input here should appear in the "display date" field regardless of what is it and it should display itself as such, like 8/2/00 without being rounded.

I hope this does not sound too confusing. It will probobly be easy for those FM wizzes. Thanks again,

Monica

Link to comment
Share on other sites

Monica,

Give this a try.

Case(

not IsEmpty(Date Override), Date Override,

Day(Enter Date) * 15, Date(Month(Enter Date), 15, Year(Enter Date)),

Day(Enter Date) > 15, Date(Month(Enter Date), Day(Date(Month(Enter Date + 17), 1, Year(Enter Date + 17)) - 1), Year(Enter Date)),

""

)

The trick is to find the last day of the month, taking into account 30 and 31 day months and Februarys in leap years. The easiest way to do this is go the the first of the next month and subtract one day. -bd

Link to comment
Share on other sites

This topic is 8667 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.