April 19, 200421 yr Hi Guys, having a problem with a very simple script that will not work in FMP7 whereas it worked fine in FMP6; If(IsEmpty(Invoice Paid Date);Int(Get(CurrentDate)-Invoice Date);0) If an invoice has NOT been paid, the above should return a value equal to the amount of days since the invoice was raised. If the invoice has been paid it should return a value of '0'. In FMP6 the script read as If(IsEmpty(Invoice Paid Date);Status(Status(CurrentDate)-Invoice Date);0) and if the invoice date was also blank then the calculation field would remain empty, however, in FMP7 if the Invoice Date field is blank the sript returns a series of numbers such as '731690'. Can anyone shed any light on why FMP7 messes this up and what I can do to correct the problem? Cheers. FileMaker Version: 7 Platform: Mac OS X Panther
April 19, 200421 yr Try: If(IsEmpty(Invoice Paid Date); If (not IsEmpty(Invoice Date); Get(CurrentDate)-Invoice Date); 0 ) Nested Status functions are not supported in FM7, and I don't think Int() is the what you want instead.
April 19, 200421 yr Author Excellent, worked perfectly. Thanks v much! PS: What is the difference (or reason for using) IsEmpty(Invoice Paid Date) instead of [FieldName]="" I tend to use the latter in calculations especially If statements but wondered if I should be using the IsEmpty syntax? Cheers
April 19, 200421 yr Nelly-> FieldName = "" will only work reliably for text fields. A good programming practice is to always use IsEmpty(), it's guaranteed to return what you expect. I used to use = "" and wondered why certain calcs blew up...
Create an account or sign in to comment