Really need Help with Syntax

Reply

Join Date: Jan 2008
Posts: 7
Reputation: LORPHI is an unknown quantity at this point 
Solved Threads: 0
LORPHI LORPHI is offline Offline
Newbie Poster

Really need Help with Syntax

 
0
  #1
Jan 20th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Really need Help with Syntax

 
0
  #2
Jan 20th, 2008
  1. Are you using crystal or basic syntax with your reports?
Last edited by iamthwee; Jan 20th, 2008 at 3:44 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: LORPHI is an unknown quantity at this point 
Solved Threads: 0
LORPHI LORPHI is offline Offline
Newbie Poster

Re: Really need Help with Syntax

 
0
  #3
Jan 20th, 2008
basic syntax
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: LORPHI is an unknown quantity at this point 
Solved Threads: 0
LORPHI LORPHI is offline Offline
Newbie Poster

Re: Really need Help with Syntax

 
0
  #4
Jan 20th, 2008
basic syntax
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Really need Help with Syntax

 
0
  #5
Jan 20th, 2008
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
Last edited by iamthwee; Jan 20th, 2008 at 3:56 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: LORPHI is an unknown quantity at this point 
Solved Threads: 0
LORPHI LORPHI is offline Offline
Newbie Poster

Re: Really need Help with Syntax

 
0
  #6
Jan 20th, 2008
The first line of code is no error, but it is highlighting the "Yes" with an error that a statement is expected here
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Really need Help with Syntax

 
0
  #7
Jan 20th, 2008
What happened?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Really need Help with Syntax

 
0
  #8
Jan 20th, 2008
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.
Last edited by iamthwee; Jan 20th, 2008 at 4:14 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: LORPHI is an unknown quantity at this point 
Solved Threads: 0
LORPHI LORPHI is offline Offline
Newbie Poster

Re: Really need Help with Syntax

 
0
  #9
Jan 20th, 2008
I deleted my complete code and did a copy and paste of yours including the quotes.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Really need Help with Syntax

 
0
  #10
Jan 20th, 2008
What happens if you do

iF {Part_Master.COMCDE_01} = "EC9" or "C09" THEN
1
ELSE
0
END IF
Last edited by iamthwee; Jan 20th, 2008 at 4:36 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Database Design
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC