sal1150 Posted February 26, 2011 Share Posted February 26, 2011 I have field "employee_sex" its value 'F' or 'M'.I like to let the variable value is 'Female' if employee_sex ='F' or'Male' if 'Female' if employee_sex ='M'IF (Female' if employee_sex =='F'){MYVAR='Female';} else{MYVAR='Memale';} Link to comment Share on other sites More sharing options...
Gaby38 Posted February 26, 2011 Share Posted February 26, 2011 I prefer do the test in the query, because I am more familiar with sql than java.select case when employee_sex = 'F' then 'Female' else 'Male' end as Sexe,.......but it is a "classical" test in java:($F{employee_sex}.equals("F"))?$V{Sexe}="Female":$V{Sexe}="Male" (I am not sure about the exact syntax) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now