February 2, 201015 yr Hello, Please help me make a calculation that will combine the first or last, 1 or 2 characters from several fields to create a Code Name for an item. For example: Season: Fall Year: 2010 Type: Shirt Item_ID: 12 Code Name: F10SH12 I've been searching for an answer for an hour and figure that I don't even know where to look. The answer is probably very simple. Thanks! Heatherrd
February 2, 201015 yr Use the Text functions like Left and Right to grab pieces of the field. Use the ampersand (&) to concatenate the text. E.g. Left(Season;1) & Right(Year;2) & etc. I highly recommend that you do NOT use your calculated code as the primary key, i.e. as a field you use to create relationships to other tables. Use an auto-entered serial number for that, and use your calculated code for labeling or whatever you have in mind. Also, Spring and Summer both start with S but I assume you have a plan for that.
February 2, 201015 yr If the code you require - F10SH12 - is first character of Season; last two of Year; first two of Type; last two of Item_ID then the calc is: Left (Season; 1)& Right(Year; 2) & Left(Type;2 & RighWords(Item; 1)
Create an account or sign in to comment