Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: Compare Date Columns

    I have two date columns (1) SCHEDULE_DATE and (2) UTC_DATE_TIME that I need to compare. SCHEDULE_DATE is stored as YYYYMMDD and UTC_DATE_TIME is stored as MM/DD/YYYY HH:MMS. There is also a START_TIME column (Oracle time - ex: 98100) that goes along with the SCHEDULE_DATE.

    I need to convert one of the date columns in order to compare and send back rows that don't match. I am new to Oracle and am not sure how to do this.

  2. #2
    Join Date
    Oct 2004
    Posts
    145
    What do you mean by oracle time?
    Excerpt from oracle documentation
    "
    Do not define columns with these SQL/DS and DB2 datatypes, because they have no corresponding Oracle datatype:
    GRAPHIC
    LONG VARGRAPHIC
    VARGRAPHIC
    TIME
    TIMESTAMP
    Note that data of type TIME and TIMESTAMP can also be expressed as Oracle DATE data.
    "

    If you mean it store the time, try comparing the following
    TO_CHAR(UTC_DATE_TIME,'YYYYMMDDHH24MISS')
    TO_CHAR(SCHEDULE_DATE,'YYYYMMDD')||TO_CHAR(START_T IME)

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    DATE datatype has NO format.
    It gets a "format" only when TO_CHAR is used.
    http://download-west.oracle.com/docs...3datyp.htm#796
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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