Jimbojames30 Posted October 22, 2012 Posted October 22, 2012 Hi all, wondering if anyone could help me out, i have moved from access to filemaker, i can do a bit of vba in access and excel but new to filemaker scripts can someone help me out i want to shorten the text depending on the length can someone help convert the below into filemaker language IIF[LotLengh]=17,Left([LotNumber],Len([LotNumber])-9),IIF[LotLengh]=18,Left([LotNumber],Len([LotNumber])-11) how would you write this in filemaker specify calculation, many thanks
comment Posted October 22, 2012 Posted October 22, 2012 I think it translates to = Let ( len = Length ( LotNumber ) ; Case ( len = 17 ; Left ( LotNumber ; 8 ) ; len = 18 ; Left ( LotNumber ; 7 ) ) ) Hard to be sure, because it doesn't make much sense. What exactly are you trying to do here?
Jimbojames30 Posted October 22, 2012 Author Posted October 22, 2012 Hi Thanks for your reply the goal is to trim the text by the length of the string , so if LotNumber is 12345678912345678 (17 charaters) then cut off the first 8 charaters so it would read 912345678 is this the best way to achieve it many thanks
comment Posted October 22, 2012 Posted October 22, 2012 I don't think that's what your code does. If you want at most 9 characters counting from the right, then = Right ( LotNumber ; 9 ) will do it without all the fuss (and the same is true in Excel and I presume in VBA as well).
Jimbojames30 Posted October 22, 2012 Author Posted October 22, 2012 Ha Ha i was just trying it out and noticed my mistake , your let solution works perfectly many thanks i changed the Left to right, the lot number field will always change lenghts so thats the need for the string once again many thanks for your advise and taking the time to help me out
Recommended Posts
This topic is 4472 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