I need to convert dt_of_birth [varchar] (15)
which is in the format DD-Mon-YYYY
to DD/MM/YYYY
.
dt_of _birth
is specified in different table and the conversion had to be done and stored in another table which has the same column name as dt_of_birth
.
First, pick the cells that contain dates, then right-click and select Format Cells. Select Custom in the Number Tab, then type 'dd-mmm-yyyy' in the Type text box, then click okay. It will format the dates you specify.
The standard date format for input and output is DD-MON-YY e.g., 01-JAN-17 which is controlled by the value of the NLS_DATE_FORMAT parameter. The following statement returns the current date with the standard date format by using the SYSDATE function.
Hi, if your input parameter is a date type then you can use the TO_CAHR convert function to get it in the dd-Mon-yy format.
Here
SELECT convert(datetime, '23/10/2016', 103) -- dd/mm/yyyy
This will work
SELECT CONVERT(CHAR(11), CONVERT(SMALLDATETIME, '27-Jan-2011', 13), 103);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With