Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Generating a future date?


shunk

Recommended Posts

Forgive me if this is an easy question to answer, but how would I generate a future date from a date already exsiting within the database?

 

For example, I have a date field called 'order date', i want to generate a date 7 months on from that original 'order date'. I'm guessing I'll need to create a calculation feild, but I'm unsure of what the calculation would look like.

 

Essentially if the order date is 01/01/2005 the generated date 7 months on would be 01/08/2005

 

Any ideas?

Link to comment
Share on other sites

I've created a calculation feild using the following calculation:

 

Date(Month(Order Date)+7;1;Year(Order Date))

 

But when i look at the dates created they don't quite match up. For example, an order date of 24/11/2004 creates a generated future date of 01/06/2005, rather than 24/06/2005.

 

IS there a way to get the correct date?

Link to comment
Share on other sites

[ QUOTE ]

Now all i need to do if figure out how that actually works

 

[/ QUOTE ]

 

aaa combined four functions:

Date(mm;dd;yyyy) to generate a date from separate number values.

Month(DateField)

Day(DateField)

Year(DateField)

to extract month, day and year from a given date (in a field).

 

kjoe

smirk.gif

Link to comment
Share on other sites

  • 3 weeks later...

Similar question with a twist:

 

I need to create a tickler -- DateMailed+30days. The problem is, I have two possible dates to check: DateMailed or DateRemailed. I'm having a heckuva time making my calculation check both and react to the latest; that is, who cares what DateMailed was if "Not IsEmpty(DateRemailed)".

 

Suggestions? Many thanks.

 

 

oh,yeah, FM6 here, but I'll need this in the v7 edition I'm creating, as well...

Link to comment
Share on other sites

umm... wouldn't that case mean I'd have to have BOTH fields contain something in order for it to be true? I can see why OR would fail, but AND/& seems just as problematic.

Link to comment
Share on other sites

DateMailed & DateRemailed merely concatenates the two fields. If both are empty, then the concatenation is empty. If either is not empty, then neither is the concatenation.

 

not IsEmpty(DateMailed & DateRemailed) is merely shorthand for

 

not IsEmpty(DateMailed) or not IsEmpty(DateRemailed)

 

or

 

not (IsEmpty(DateMailed) and IsEmpty(DateRemailed))

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use