Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASE function

Status
Not open for further replies.

abowling

Technical User
Apr 27, 2005
33
US
I have a list of employee annual salary rates.
I would like to return a value (ie A, B, C etc) when the annual salary rate falls within a salary range.

Here is what I tried:

CASE "PS_EMPLOYEES"."ANNUAL_RT"
WHEN '>22359 AND <28080 THEN 'A'
WHEN '>28079 AND <35360 THEN 'B'
ELSE 'NONE'
END

I am getting the missing right parenthesis error. Any help would be greatly appreciated.
 
This will depend on the database you are using. With Oracle it would be:

CASE
WHEN "PS_EMPLOYEES"."ANNUAL_RT" > 22359 AND "PS_EMPLOYEES"."ANNUAL_RT" < 28080 THEN 'A'
WHEN '"PS_EMPLOYEES"."ANNUAL_RT" > 28079 AND "PS_EMPLOYEES"."ANNUAL_RT" < 35360 THEN 'B'
ELSE 'NONE'
END


CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining
 
Thanks I will give that a shot. I am using Oracle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top