July 9, 20178 yr Howdy, all. I know I'm close...maybe. I'm trying to create a calc that'll strip the last five characters off a field name, regardless of its length. So far, I've come with: Left ( Get ( ActiveFieldName ) ; Length ( Get ( ActiveFieldName ) - 5 ) ) ...but it's not working, e.g., with a field name of County__lxt the result of the calc is Co. I thought of using multiple Substitute commands but that's shaping up to being real klunky. What's the final bit that I need? As always, thanks in advance for your help!
July 9, 20178 yr Try: Left ( Get ( ActiveFieldName ) ; Length ( Get ( ActiveFieldName ) ) - 5 ) Remember both Length() and Get() need closing brackets BEFORE the Left() is closed.
July 9, 20178 yr 10 hours ago, WF7A said: I know I'm close... Yes, you are. To expand on what LaRetta said, you are subtracting 5 from the actual field's name, instead of from its length. You are doing = Get ( ActiveFieldName ) - 5 which in your example is evaluated as = "County__lxt" - 5 resulting in -5. And since the length of "-5" is 2 characters, you're getting the first 2 characters of "County__lxt" as the overall result.
Create an account or sign in to comment