Solved

Statement Required Here

Posted on 2011-03-17
5
409 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
  • 3
  • 2
5 Comments
 
LVL 100

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 100

Accepted Solution

by:
mlmcc earned 500 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 100

Expert Comment

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

mlmcc
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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. …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

14 Experts available now in Live!

Get 1:1 Help Now