0

I am a network guy and not at all a programmer, but as I work for a small unit in a big company I have been given duties for a specific job and can not complete.
I am trying to write code for a crystal report to do to theings. One is to take data out of database record that has specific strings and if returned the strings then post an alpha value in retur. This is what I wrote

iF {Part_Master.COMCDE_01}.STRING = EC9 or C09 or CO0 OR ECC OR COC OR ECT OR COT OR ECCR OR CRF OR ECWP OR WPF THEN
"RED"
ELSE
RCBW OR RCSO OR RABW OR RASO OR STE THEN
"CLR"
ELSE
MEX OR WPS OR WPW OR SGW OR WP3 OR WPM OR WPE OR CR3 OR CRM OR CRE OR ABE OR EKE OR CAE OR LAE THEN
"ELB"
ELSE
TE9 OR TE1 OR TECR OR TEWP THEN
"TEES"
ELSE
"SP"
END IF

Does not like it

The next thing I have to do is display a specific section of a String that is a value in the report from a foield in a database

The value is similar to the 4125321937. I need to display the forth and fifth characters of the string but have no idea.

Can anyone help me?

2
Contributors
14
Replies
15
Views
9 Years
Discussion Span
Last Post by iamthwee
0

Right, I mainly use crystal syntax but I'll try to help anyway.

iF {Part_Master.COMCDE_01}.STRING = EC9 or C09 or CO0 OR ECC OR COC OR ECT OR COT OR ECCR OR CRF OR ECWP OR WPF THEN

Try testing the below and tell me if it works.

iF {Part_Master.COMCDE_01} ="EC9" or "C09" THEN
"YES"
ELSE
"NO"
END IF

0

The first line of code is no error, but it is highlighting the "Yes" with an error that a statement is expected here

0

Are you using only the code I posted and nothing else. Did you copy and paste it into the formula? Have you put the quote marks around the EC9 etc.

0

I deleted my complete code and did a copy and paste of yours including the quotes.

0

My security company wants me to leave. I am out of the office tomorrow...thank you for your help and I will look again Tuesday to see if available

0

Ok, I'll look at this tomorrow, at the moment I'm working blind, so there could be a syntax error (possibly the newline), as I said I normally use Crystal syntax.

0

I believe you need to something like:-

If {Part_Master.COMCDE_01} = "002" Then
Formula = "ok"
ElseIf {Part_Master.COMCDE_01} = "001" Then
Formula = "no"
Else
 Formula = "maybe"
End If
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.