Jump to content
Sign in to follow this  
aldipalo

Help with a text calculation

Recommended Posts

I thought this would be simple, but, it's driving me crazy!!!!

Here's what I'm trying to do. I have a text field fk_UnitID that contains the following type data.

I-02F or II-04G or I-12A, etc. The I or II denotes the Building and the right side the apartment. I set up a calculation to get the Building from the UnitID:

Case(

Left(FK_UnitID;2) = "-";Left(FK_UnitID;1);

Left(FK_UnitID;2)

)

My problem is I get the II if the unit is II-02F

but get, I- if the unit is I-12A. I just want I.

What am I doing wrong?:

TIA

Al

Share this post


Link to post
Share on other sites

If the format is consistent, i.e. there's always a letter just before the hyphen and a numeric character immediately after, you can use:

LeftWords ( UnitID ; 1 )

Share this post


Link to post
Share on other sites

Excellent. I tried Leftwords, but I was doing doing some fool thing wrong because it just wasn't working. Thanks for the quick reply.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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