hartmut77 Posted June 22, 2005 Posted June 22, 2005 Hello I have a field with is called priority code. "PC" I have another calculation field which is called "TEXTCODE" the numbers are sequential from 1 to 7 and then they are ranges like 13-15 I have statements to be calculated to the field "TEXTCODE" and I need help writing them because they are lot. The table is this 1= "RED" 2= "GREEN" but 7-10 = "BLUE" So if the user enters in 8 it would be " Blue " in the text field I have to write this formula and i need help Thanks Dave
sbg2 Posted June 22, 2005 Posted June 22, 2005 Using the examples you provided one way would be a Case statement. TEXTCODE = Case( PC = 1; "RED"; PC = 2; "GREEN"; PC > 6 and PC < 11; "Blue") Another way would be to create a PC table with two fields PC and TEXTCODE. Record one PC =1, TEXTCODE = RED, record two PC = 2, TEXTCODE = GREEN etc. Then relate this new PC table to your main table by PC = PC, TEXTCODE in the main table would be a calcualtion = PC::PC.
RalphL Posted June 22, 2005 Posted June 22, 2005 This is a good place for the case statement. Something like this: Case ( PC >= lowest number in highest range; Color for highest range; PC >= lowest number in next highest range; Color for next highest range; and so on PC >= 7; "Blue"; PC = 6; Color for 6 and so on PC = 2; "Green"; PC = 1; "Red" )
Recommended Posts
This topic is 7162 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