I have a date column upon casting it shows the result in differnt format in differnt environment.
here is my query.
SELECT DT_END_RANGE AS A ,CAST(DT_END_RANGE AS CHAR(10)) AS B , CAST(CAST(DT_END_RANGE AS CHAR(10)) AS DATE) AS C FROM TAB1 WHERE YR=2014
output in 1 environment:
A B C
9/16/2014 14/09/16 9/16/1914
The same query in differnt environment
output in 2 environment:
A B C
9/16/2014 2014-09-16 9/16/2014
I hope it is environment issue, but let me know how can we fix this ?
which tool do you use to run the query?
you use the same tool for both queries?
on both environments.
check if the date field contains different format strings in the different environements.
you can apply format string in date field.
SELECT current_date AS A ,CAST(cast(current_date as date format 'dd/mm/yyyy') AS CHAR(10)) AS B , CAST(CAST(current_date AS CHAR(10)) AS DATE) AS C ;