?
Solved

MS SQL script conversion error in dates

Posted on 2016-11-02
3
Medium Priority
?
38 Views
Last Modified: 2016-11-02
Hi,

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
0
Comment
Question by:rayluvs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:rayluvs
ID: 41870087
Ok other words our format is mm/dd/yyyy thier format date is dd/mm/yyyy.

FYI
0
 
LVL 51

Accepted Solution

by:
Vitor Montalvão earned 2000 total points
ID: 41870098
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.
0
 

Author Closing Comment

by:rayluvs
ID: 41870161
Thanx!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question