Date Format Conversion [message #1877] |
Thu, 06 June 2002 22:39  |
Achintya
Messages: 1 Registered: June 2002
|
Junior Member |
|
|
I want to convert date in format dd/mm/yyyy to date format mm/yyyy with the restriction that the resultant value is date type.
|
|
|
Re: Date Format Conversion [message #1880 is a reply to message #1877] |
Fri, 07 June 2002 03:02  |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
This is just for display purposes then, because Oracle has its own internal date format (including time indication). You can, however set the NLS date format.
e.g.:
SQL> alter session set nls_date_format = 'MM/YYYY';
Session altered.
SQL> select sysdate from dual;
SYSDATE
-------
06/2002
To compare to dates: wrap a to_date(to_char(date_field,'MM/YYYY'),'MM/YYYY') around your date_fields. The database will lose all info concerning day and time.
MHE
|
|
|