Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Unanswered: what is wrong in the following CASE statement

    Could someone point out why i am getting the following error in the statement.

    select docid,
    case trunc(date1-date2)*24)when 0 then '01'
    when 1 then '02'
    else '72' end as diff
    from table1;


    case trunc(dtm_log-dte_log)*24)when 0 then '01'
    *
    ERROR at line 2:
    ORA-00923: FROM keyword not found where expected

    Thanx and Regards
    Aruneesh

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    you are missing a '('

    anyways, look at my code in your other post.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Jul 2003
    Location
    US
    Posts
    314
    Hi DUCK,
    I figured out the syntax for the CASE I was using was incorrect. It should have been

    CASE WHEN expr THEN ...
    ELSE ... END AS DIFF.

    Thanx and Regards
    Aruneesh

    Originally posted by The_Duck
    you are missing a '('

    anyways, look at my code in your other post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •