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 gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with case stmt 1

Status
Not open for further replies.

ejaggers

Programmer
Feb 26, 2005
148
US
How do you label the column using a case stmt? I want the prem_term_date case labe to be "DISABLED", but AS "DISABLED", gives me an error.

SELECT prem_fname || " " || prem_lname AS NAME,
" " AS LOGON,
" " AS EMAIL,
CASE
WHEN prem_term_date IS NOT NULL AND prem_term_date < TODAY-120
THEN "true"
ELSE "false"
END,
"false" AS LOCKEDOUT

FROM prempmst
WHERE prem_proj = 0

 
What about this?
Code:
SELECT  prem_fname || " " || prem_lname AS NAME,
        " " AS LOGON,
        " " AS EMAIL,
        CASE
        WHEN prem_term_date IS NOT NULL AND prem_term_date < TODAY-120 THEN "true"
        ELSE "false"
        END AS NOT_ENABLED
        "false" AS LOCKEDOUT
  FROM prempmst
  WHERE  prem_proj = 0

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top