3
I am having problems when selecting a date column in SQL Server. It turns out that my data is in format dd/mm/aaaa
and when I select this column the SQL reverses getting aaaa-dd-mm
and it actually had to be aaaa-mm-dd
.
This happens on some dates like 02/12/2014
he converts as 2014-02-12
.
The type of column is datetime2(7)
This is the standard format of the bank, I believe that there is no way you can change this and nor should you. This formatting should be done in the application.Use the date classes that exist in many languages for this, so you don’t have to keep converting by hand.
– user28595
Which version of SQL Server and which column type?
– rray
SQL Server 2012 and column type is datetime2(7)
– Kleber Yassuda
Kleber, when answering someone in the comments, remember to quote the person you are responding to, or they will not be notified of your response. I believe you answered @rray’s question
– user28595
take a look at this example http://answall.com/questions/58521/como-saber-qual-formato-de-datetime-utilizado-em-determinada-coluna-do-sql-serve/58546#58546
– durtto