Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Topic: probelm using select case Posted: 05 Sep 2012 at 2:41am
when I run this report using the select case code below it tells me that every employee is of asian descent. Am I doing something wrong here?
Thank you in advance for your help!
//A Asian //B African American //F Foreign National //H Hispanic //I Native American/Alaskan Native //M Middle Eastern //O Other //P Native Hawaiian or Pacific Islander //T Two or More Races //Undefined Undefined //W Caucasian
Select {CEthnicity.ethnicity} case "A" :"Asian" case "B" :"African American" case "F" :"Foreign National" case "H" :"Hispanic" case "I" :"Native American/Alaskan Native" case "M" :"Middle Eastern" case "O" :"Other" case "P" :"Native Hawaiian or Pacific Islander" case "T" :"Two or More Races" case "Undefined" :"Undefined" case "W" :"Caucasian" Default :"Undefined";
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 05 Sep 2012 at 3:55am
What error are you getting? If you're not getting any data, try taking the semi-colon (;) off the end of it. Personally, I tend to use the Crystal Syntax "Switch" statement instead of select/case. It would look something like this:
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Posted: 05 Sep 2012 at 4:08am
thank you for your quick reply. i tried removing the semi colon from the end of the code and still got the same result. i changed out the code completely and tried the "switch" statement and that is still giving me the same result.
it is returning data however it is telling me that every employee is Asian instead of going through the whole statement and showing their true ethnicity.
any thoughts? this is the current code from the report.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 05 Sep 2012 at 4:34am
I would put the {CEthnicity.ethnicity} field on the report and see what data is being returned in it just to validate that the various values are there.
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Posted: 05 Sep 2012 at 4:47am
thank again dell, here is what i am getting returned when i just use {CEthnicity.ethnicity}
LastName
FirstName
Annual
Salary
FT/PT
Heflin Catherine A F
LastName
FirstName
Annual Salary
FT/PT
Hill Justin A M
LastName
FirstName
Annual Salary
FT/PT
Hill Natasha A F
LastName
FirstName
Annual Salary
FT/PT
The 'A' (Asian) is returning for every employee. so i'm assuming it's the actual database that is incorrect? when i run this as a sql query it returns the correct data ie employees lastname, firstname and ethnicity.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum