Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    3

    Unanswered: Select Case Columns

    When I try to do the following SQL statement to select a different column it gives the error below as one is a date and one a number

    [I]ORA-00932: inconsistent datatypes: expected DATE got NUMBER

    Select
    CASE WHEN 2=1 THEN DATE+TP_PERIOD/48 ELSE TP_PERIOD END DATETIME,


    Is there a way to use TOCHAR or something so I can get either result in one column?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    May 2012
    Posts
    3
    Would this work giving the output with 48 time periods if the condition is true

    DATE
    1
    2
    3
    48

    or in the below format if false

    DATE
    3/05/2012 0:30
    3/05/2012 1:00
    3/05/2012 23:30
    4/05/2012 0:00

  4. #4
    Join Date
    Apr 2012
    Posts
    213
    Bradh_nz,

    I believe it is better you post your question in the Oracle category.

Posting Permissions

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