Desktop productivity for business analysts and programmers

SAS SQL - CASE STATEMENT

Accepted Solution Solved
Reply
Learner
Posts: 1
Accepted Solution

SAS SQL - CASE STATEMENT

I would ask about how can I write date in case statement after then. For example, I tried this context  (case when x=1 then '01jul2009'd),

but, unfortunately, it dosen"t work.  


Accepted Solutions
Solution
‎05-22-2016 02:30 AM
Super User
Super User
Posts: 6,851

Re: SAS SQL - CASE STATEMENT

[ Edited ]

Syntax looks ok, but your parentheses are in the wrong place and you are missing the END keyword.

 

case when (x=1) then '01jul2009'd end as DATE1

 

View solution in original post


All Replies
Solution
‎05-22-2016 02:30 AM
Super User
Super User
Posts: 6,851

Re: SAS SQL - CASE STATEMENT

[ Edited ]

Syntax looks ok, but your parentheses are in the wrong place and you are missing the END keyword.

 

case when (x=1) then '01jul2009'd end as DATE1

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 296 views
  • 1 like
  • 2 in conversation