Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7521 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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...

This topic is 7521 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.