Solved

CODES IN NOTES FIELD If then statement - then error

Posted on 2011-02-21
3
323 Views
Last Modified: 2012-05-11
I'm not very good at doing any of this but I'm learing. I'm trying to decipher a from a list of 14 codes which get entered into a notes field. The codes are supposed to be the first items entered into the field but at times I've notice a space before they start the codes. I'm trying to find where all the errors are in the fields when the users enter the incorrect codes. The reason is im' trying to create groups for these specific codes only but keep getting other codes because they aren't entered correctly. I have started what I thought would work and it does for the first code and if I stop there the formula works fine, but I need the other 13 to work as well. Any ideas. I keep getting a "The keyword 'then' is missing in the below formula. I know I'm obviously doing something wrong but I don't know what?

IF Left({View_RscMaster_History.Staffing_Note_Vc},2 ) = "MS" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},3 ) = "CAR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "CMTE" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "SPEC" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "BFHM" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "INST" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "BFPAR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "BFSCH" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "EVENT" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "NREMT" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "HMSCH" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},6 ) = "FRSTYR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},7 ) = "FIREINV" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},7 ) = "CPRINST" then "" else  "WRONG CODE"
0
Comment
Question by:RandyMFire
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 125 total points
ID: 34944225
Remove all the 'IF's except the first one.
0
 

Author Comment

by:RandyMFire
ID: 34944360
Thanks. That was it.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34945010
If there are leading spaces you could use TRIM or LTRIM to remove them before testing

mlmcc
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now