How do i change date format in the database

How do i change date format in the database

Take a look at the TO_CHAR function

Read more here

Take a look at the TO_CHAR function

Read more here

Thanks for your reply the problem is solved

To change date type use to_char() function.

ALTER SESSION set NLS_DATE_FORMAT = 'DD/MM/YYYY';

PLEASE USE THE ABOVE CODE

The Alter session is a temporary solution, that makes your session only appears with the format specified..
If you want to create a report or a query or a script that always appear with a specific format then go with TO_CHAR()

Use To_char Function
To_char(date,'dd-mm-yyyy') In Which Format You Use
Also To_date Function
To_date(date,'dd-mm-yyyy')
Also
To_char(to_date(date,'dd-mm-yyyy'),'dd-mm-yyyy'))

Can Any one tell how to convert String datatype 2 sql

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.