cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Syntax

Former Member
0 Kudos

Hi

1. Can someone please tell me whats the error in the below statement:

if ({w.LOGIN} = CurrentCEUserName) then (region := {w.fk_client_region_id};)

The check says its missing a ) .

2. Also , how do I add mysql queries to such group formulas, for ex:

I want to bring all users based on some criteria

ex:

level := {w.level};

if(w.user = CurrentCEUSERNAMe) then

select * from w where w.level =level;

Thanks for your time

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

change from this

if ({w.LOGIN} = CurrentCEUserName) then (region := {w.fk_client_region_id};)

to this- put your semi colon on the other side of the )

if ({w.LOGIN} = CurrentCEUserName) then (region := {w.fk_client_region_id}) ;

Answers (1)

Answers (1)

Former Member
0 Kudos

As for the adding your sql to a formula you can't because a sql expression require only one value to return.

You may have to use a subreport to get the desired results

Former Member
0 Kudos

Ok I changed the syntax and put the semicolon in the end after the ) but still it says missing ) near the region highlighting it.

Former Member
0 Kudos

you need to declare the variable region

add this to your formula abouve the if statement:

global stringvar region;