shunk Posted February 21, 2005 Share Posted February 21, 2005 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 More sharing options...
aaa Posted February 21, 2005 Share Posted February 21, 2005 Your calculation must be like: Date(Month(Order_Date)+7,01,Year(order_Date)) Link to comment Share on other sites More sharing options...
shunk Posted February 21, 2005 Author Share Posted February 21, 2005 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 More sharing options...
aaa Posted February 21, 2005 Share Posted February 21, 2005 Sorry! This must be: Date(Month(Order_Date)+7,Day(Order_Date),Year(order_Date)) Link to comment Share on other sites More sharing options...
shunk Posted February 21, 2005 Author Share Posted February 21, 2005 Cool! That's the one! Thanks. Now all i need to do if figure out how that actually works. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted February 21, 2005 Share Posted February 21, 2005 [ 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 Link to comment Share on other sites More sharing options...
Bush Posted March 9, 2005 Share Posted March 9, 2005 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 More sharing options...
-Queue- Posted March 10, 2005 Share Posted March 10, 2005 Case( not IsEmpty(DateMailed & DateRemailed), Max( DateMailed, DateRemailed ) + 30 ) Link to comment Share on other sites More sharing options...
Bush Posted March 14, 2005 Share Posted March 14, 2005 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 More sharing options...
-Queue- Posted March 14, 2005 Share Posted March 14, 2005 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.