kiwiora Posted January 17, 2003 Posted January 17, 2003 I have several fields. Main one being "Date of Accident" calculated from this are various "milestones". E.g Milestone 1 = Date of Accident + 91 (being three months) Milestone 2 = milestone 1 + 185 (being six months) etc etc 1st Question is this the best way to add set time frames onto a user field?? 2nd Question If Instructions were received Up to and including 30 June 2001 i need to add 30 days, if received on or after 1 July 2001 i need to add 14 days. DateInstruction + If( DateInstruction >= "01/07/2001", 14 , 30 ) but it doesn't work... it just adds 14 whether it be post or prior to 1/7/2001???
kenneth2k1 Posted January 17, 2003 Posted January 17, 2003 Hi: 1. I would suggest using Month(Milestone). Then you can just add months instead of days. 2. I cant really test this right now, but you might wanna try doing this: Create another field to perform the calc on DateInstruction. I'll call it DateProjection= If(DateInstruction <= 7/30/2001, DateInstruction + 30, DateInstruction + 14) If i read your post correctly Ken
kenneth2k1 Posted January 17, 2003 Posted January 17, 2003 I just realized that I posted an american date format. (30/7/2001)
Lee Smith Posted January 17, 2003 Posted January 17, 2003 I have several fields. Main one being "Date of Accident" calculated from this are various "milestones". E.g Milestone 1 = Date of Accident + 91 (being three months) Milestone 2 = milestone 1 + 185 (being six months) etc etc 1st Question is this the best way to add set time frames onto a user field?? 2nd Question If Instructions were received Up to and including 30 June 2001 i need to add 30 days, if received on or after 1 July 2001 i need to add 14 days. DateInstruction + If( DateInstruction >= "01/07/2001", 14 , 30 ) but it doesn't work... it just adds 14 whether it be post or prior to 1/7/2001??? Hi, I have enclosed a small demo file showing how this can be done. I think that it is self explanatory, however, if you have any questions, please feel free to contact me off list or on. I have used regular US dates, so you will need to either settle for military or regular before proceeding with and any calculations, etc. to your file. HTH Lee
Ugo DI LUCA Posted January 17, 2003 Posted January 17, 2003 TEST(date instruction <= DATE(06; 30; 2001) ;date instruction +30; date instruction >= DATE(07; 01; 2001); date instruction+14) Works for me. But you have to imagine what the french functions could be in an english FM I think DateNum for DATE and Surely Case for TEST
kiwiora Posted January 17, 2003 Author Posted January 17, 2003 Hi, Are you able to post it as a zip file??? Cheers Jan
CobaltSky Posted January 17, 2003 Posted January 17, 2003 Assuming that 'DateInstruction' is defined as a date field, the correct syntax will be: DateInstruction + Case(DateInstruction < Date(7, 1, 2001), 14, 30)
Lee Smith Posted January 17, 2003 Posted January 17, 2003 Here you go. BTW, there is a free StuffIt Expander available from Allidin, just type www.stuffit.com in your browser and that should take you right to their site. HTH Lee AccidentAccounting.fp5.zip
Recommended Posts
This topic is 8051 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 accountSign in
Already have an account? Sign in here.
Sign In Now