Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting A Date Column 1

Status
Not open for further replies.

campbere

Technical User
Oct 10, 2000
146
US
I would like to adjust the format of a date column in Oracle 8. How do I do this? Currently the column is 11-Apr-01 I would like MM DD YYYY

Thanks.
 
As you may already know, the internal storage of a date column doesn't change, regardless of how the date is displayed. Therefore the question boils down to modifying the format for display purposes.

1. To change the format within a single sql statement, specified the desired format:

select to_char(sysdate,'dd-mm-yyyy') from dual;

2. To change the format for the duration of a session

alter session set nls_date_format='dd-mm-yyyy';

3. To change the format for all users, set the value of nls_date_format in the init.ora file, then shutdown and restart the instance.

nls_date_format = 'dd-mm-yyyy'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top