kenneth2k1 Posted October 9, 2001 Posted October 9, 2001 In reference to the script I described in the post "Scripts that Run Automatically" It appears that the date calculation in the if function: If ["Status(CurrentDate) >= Letters P Date 4 + 4) and (Letters4 = "Action WS") and (IsEmpty(Action List))"] is not working. I know this because the date in field "Letters P Date 4" has yesterday's date in it, so the current date is NOT at least four days from the date in field "Letters P Date 4". The other conditions seem to work. The interesting part is that the if function here is very similar to ones that I have in other scripts that DO work. Any suggestions on what to look for or fix?? Thanks, Ken
LiveOak Posted October 9, 2001 Posted October 9, 2001 What is the calculation supposed to do (described in English)? For this calculation to "fail" for dates closer together than 4 days, it would need to return a "TRUE" or "1" result when the other "and" conditions are met. Is this the case? -bd
kenneth2k1 Posted October 9, 2001 Author Posted October 9, 2001 Thanks for the reply, LiveOak. Basically, this is the story: My marketing strategy relies on three letters that go out in succession. Four days after the third letter, a call is suppose to be made, so a call worksheet prints. As a result of the call, and therefore information put on the call worksheet, the user checks a box in a Value List. If nothing has been input (no boxes checked) in 4 days, I would like a Late Action Notice to print, informing the user that they are slacking on this client. However, some records may not be active and will have no information, so they don't need the Late Action Notice to print for them. That's why there are those other conditions there. I want it to look for these things (and your suggestions are greatly appreciated): 1) Check if the call worksheet printed 2) Check if any of the checkboxes have been checked (how much wood would a woodchuck chuck....) 3) Check if the date that the call worksheet printed was 4 or more days ago The record must meet ALL these criteria. If not, the record must be omitted. Then take these records and go to the Late Action Notice layout and print them. Here is the script for quick reference. Go to Record/Request/Page [First] Loop If ["Status(CurrentDate) >= Letters P Date 4 +4) and (Letters4 = "Action WS") and (IsEmpty(Action List)"] Go to Record/Request/Page [Exit after last, Next] Else If ["(Status(CurrentDate) >= Letters P Date 1.4 + 4) and (Letters1.4 = "Action WS") and (IsEmpty(Action List)"] Go to Record/Request/Page [Exit after last, Next] Else If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"] Omit Record Exit Loop If ["1"] Else Omit Record End If End If End If End Loop Go to Layout ["Late Action Notice"] ....blah, blah, blah..... Print As I posted earlier, the date condition doesn't seem to be working. Any better ideas on means to an end are welcome. Thanks, LiveOak Ken
kenneth2k1 Posted October 10, 2001 Author Posted October 10, 2001 Check this out also: I set the fields "Letters P Date 4" and "Letters P Date 1.4" to Oct. 15, which isn't for another few days, so I would know for sure that the records would NOT meet the criteria: Status(CurrentDate) >= Letters P Date 4 + 4 but sure enough, they printed anyway. Again, if I take the date calculation out, it abides by the other calcualtions just fine. Any suggestions....anyone....anyone.....(don't leave me now liveoak!) Thanks All! Ken "Feed me, Seymo', feed me!"
kenneth2k1 Posted October 11, 2001 Author Posted October 11, 2001 LiveOak: In response to your question that you posted ealier, the answer is Yes. I was hoping that it would fail if the current date (Status(CurrentDate)) was less that four days from the date in field "Letters P Date 4." But, in order for it to succeed, I wanted it to return a true answer for Status(CurrentDate) >= Letters P Date 4 + four days. ***AND*** Letters4 = "Action WS" ***AND*** IsEmpty(Action List) If the script looks correct, please let me know. In case you were wondering, Ive left out the 2nd if function because it is similar, and once I can get a solution for this, I can apply it to that one, so it is superfluous (did I spell that right??) at this time. Anyways, I eagerly await your reply. Ken
clevow Posted October 17, 2001 Posted October 17, 2001 I'm having problems with a date calculation as well. I'm trying to auto-enter a calculation, but having this calculation in a script results in the same problem. Basically, I am using a long IF statement to determine what semester it is. If today's date falls between two dates, then it's in X Semester. The code looks like this: If(Status(CurrentDate)>08/13/2001 and Status(CurrentDate)<=12/20/2001,"Fall 2001", If(Status(CurrentDate)>12/20/2001 and Status(CurrentDate)<=05/15/2002,"Spring 2002", If(Status(CurrentDate)>05/15/2002 and Status(CurrentDate)<=08/12/2002,"Summer 2002", If(Status(CurrentDate)>08/12/2002 and Status(CurrentDate)<=12/18/2002,"Fall 2002", If(Status(CurrentDate)>12/18/2002 and Status(CurrentDate)<=05/14/2003,"Spring 2003", If(Status(CurrentDate)>05/14/2003 and Status(CurrentDate)<=08/11/2003,"Summer 2003", If(Status(CurrentDate)>08/11/2003 and Status(CurrentDate)<=12/17/2003,"Fall 2003", If(Status(CurrentDate)>12/17/2003 and Status(CurrentDate)<=05/13/2004,"Spring 2004", If(Status(CurrentDate)>05/13/2004 and Status(CurrentDate)<=08/10/2004,"Summer 2004","Fall 2004") )))))))) Regardless of the date, "Fall 2004" is returned. I've dumbed this statement all the way down to: If(10/16/2001<12/20/2001 ,"Fall 2001","Spring 2002") and it returns "Spring 2002" Any suggestions? Correct me if I'm wrong, but FM should be able to handle date comparisons like this. Thanks, Carrie
rdhaden Posted October 17, 2001 Posted October 17, 2001 Carrie, I think you need to turn all dates from 8/13/2001 to TexttoDate("8/13/2001")
kenneth2k1 Posted October 18, 2001 Author Posted October 18, 2001 switch your dates to look like this: (mo,dy,year)<- with the commas instead of slashes. Ken
kenneth2k1 Posted October 18, 2001 Author Posted October 18, 2001 I seemed to have fixed this problem...all I did was re-enter the calculation, and it worked. I didn't think anything was different, but who knows. Chao!
Recommended Posts
This topic is 8442 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