Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have the following scrip that does not work...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Left (Job System::gdate; 2) = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

Else

Exit Script

End If

I think there is something wrong with the If statement, because it performs: Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)] no matter what it finds.

Can anyone point out where I am going wrong?

Posted

I tried simplifying the scrip to...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Job System::gdate = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

End If

But it still doesn't work, its like its just ignoring the If statement and resetting the field no matter what!

Posted

Why not use

Set Field [Job System::gdate; Day(Job System::date)]?

You'll get the same result in one step.

Posted

Then use Month(Job System::date). Date functions don't care about your system settings. They'll still return the right result.

Posted

No wait, I figured it out... the date fields are formatted mm/dd/yy. Once I changed them to our format, it worked!

Thanks smile.gif

Posted

The format shouldn't matter, because dates are internally stored as numbers. So Month(datefield) will work for any legal format or system setting since it doesn't pay attention to them.

Posted

But Cat8 is using string manipulation commands, like Left and Middle, and so I think it would matter. That's why I asked for the format of date and gdate.

Posted

I was referring to format, not field type. And yes, Cat was using string commands that aren't necessary when a simple Month( ) function will suffice. wink.gif

Posted

Right. Why use string manipulation when the month function will work regardless of field format!

This topic is 7394 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.