Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CODES IN NOTES FIELD If then statement - then error

Posted on 2011-02-21
3
Medium Priority
?
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 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 101

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

670 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