MS SQL script conversion error in dates


We are attending a central america site and when we run a script develop in our US site, it gives the error:

Msg 242, Level 16, State 3, Line 1
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

Open in new window

So we think its the sql instance at thier end.

Question, how to convert our script to follow their region dates
Who is Participating?
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
SQL Server engine always stores the data as YYYYMMDD. The format is a client side so if you want to perform any operation internally convert always to YYYYMMDD no matter the country the server is.
rayluvsAuthor Commented:
Ok other words our format is mm/dd/yyyy thier format date is dd/mm/yyyy.

rayluvsAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.