DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 16

Thread: difference between max(datecolumn) and max(to_date(datecolumn),'dd-mm-rrrr')

Threaded View

  1. #7
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    My guess is that your data includes two dates:
    31-MAY-2003 and 03-JUL-1903

    MAX(datecolumn) gives the correct value: 31-MAY-2003.

    What I think is happening in the second expression is:
    For the TO_DATE to work, datecolumn is somehow first converted to characters (it expects character input NOT a date - I'm surprised it does not give an error):
    03-JUL-03
    This then converted back to date with -RRRR becomes:
    03-JUL-2003
    which is bigger than 31-MAY-2003

    (All this can be avoided if you make sure your default date format includes YYYY).

    . . on the other hand I could be wrong.
    Last edited by DaPi; 07-04-2003 at 03:09 AM.

Posting Permissions

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


Click Here to Expand Forum to Full Width