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. #9
    Join Date
    Feb 2001
    Posts
    125
    i have run query using format 'YYYY' output is something like
    below

    perhapes copy-paste is not proper... so i am also attaching text file


    SQL> select to_char(min(to_date(datecolumn,'dd-mm-yyyy')),'dd-mm-yyyy'),to_char(max(to_date(datecolumn,'dd-mm-yyyy')),'dd-mm-yyyy')
    2 from atable
    3
    SQL> /

    TO_CHAR(MI TO_CHAR(MA
    ---------- ----------
    16-05-0003 02-07-0003

    SQL> select to_char(min(datecolumn),'dd-mm-yyyy'),to_char(max(datecolumn),'dd-mm-yyyy')
    2 from test.atable
    3
    SQL> /

    TO_CHAR(MI TO_CHAR(MA
    ---------- ----------
    16-05-2003 31-05-3003



    1* select to_char(max(to_date(datecolumn,'dd-mm-yyyy')),'dd-mm-yyyy') from atable
    SQL> /

    TO_CHAR(MA
    ----------
    02-07-0003

    SQL>
    Attached Files Attached Files

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