[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Statement Required Here

Posted on 2011-03-17
5
Medium Priority
?
429 Views
Last Modified: 2012-05-11
I have developed a report that has multiple problem codes that I want to translate into a phrase for a customer to understand what took place.  I wrote the forumula in Basic Syntax but keep getting the error message a Statement is required here after the Then.  Here is my formula:

If {SP_WO_OpenCLose_VW.wd_p_id} ="PEA" Then "Electronics-Not Printing"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEB" Then "No Print Go"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEC" Then "No Paper"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PED" Then "No Power"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEE" Then "Phasing Error"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEF" Then "No Data Entry"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEG" Then "Electronics Overheating"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEJ" Then "In Reset"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEQ" Then "Communication Error"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PMS" Then "Preventative Maintenance"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEO" Then "Boot Startup Failure"
Else "No Error Captured"
End If


What am i missing?
0
Comment
Question by:jefjar
[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
  • 2
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 35156733
2 ways to fix this

1.  Use Crystal syntax and change the Esle If to EsleIf

2 Use Basic syntax and change it to

If {SP_WO_OpenCLose_VW.wd_p_id} ="PEA" Then Formula = "Electronics-Not Printing"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEB" Then Formula = "No Print Go"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEC" Then Formula = "No Paper"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PED" Then Formula = "No Power"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEE" Then Formula = "Phasing Error"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEF" Then Formula = "No Data Entry"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEG" Then Formula = "Electronics Overheating"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEJ" Then Formula = "In Reset"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEQ" Then Formula = "Communication Error"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PMS" Then Formula = "Preventative Maintenance"
Else if {SP_WO_OpenCLose_VW.wd_p_id} ="PEO" Then Formula = "Boot Startup Failure"
Else Formula = "No Error Captured"
End If

mlmcc
0
 

Author Comment

by:jefjar
ID: 35156856
Thanks for that but now everything after the first If statement is highlighted and I get the error message "The remainig text does not appear to be part of the formula."  If checked the statement and made sure that I am in basic syntax.  What am I missing?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 35159206
Sorry had the 2 backwards.
If {qryHoursWorked.CompanyName} = "123" then
   formula = "123"
Elseif {qryHoursWorked.CompanyName} = "321" then
   formula = "321"
Else
      formula = "432"
End if

Your orignal works in Crystal syntax without the End If

Change the one I gave to use ElseIf

mlmcc
0
 

Author Closing Comment

by:jefjar
ID: 35160121
Trying to keep me on my toes huh?  Thanks for the solution it worked.  One of these days Ill get my syntaxes worked out.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35160918
I always use Crystal so when I try the basic I get things backwards.

mlmcc
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

650 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