Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2015
    Posts
    2

    Unanswered: Excel SQL Query works in US but errors in India

    I can NOT figure this out and am looking for any help possible! I have an excel workbook that uses a query that connects to and retrieves data from a SQL server in my building. Everything runs fine when it is run here in the US. When i email the workbook to the team in India and they run it they receive the error: Run-Time error -2147217913 Conversion failed when converting data and/or time from character string. on the first query. the query basically grabs data based on the date entered. however, this is done by the user selecting the current month and year in a combobox, this gets passed to a variable as 'JUN-15' (string) then it is passed to the sql server where a date lookup is done and returns sets the date 2015-07-01 to a variable IN the sql server. data is then returned based on that value.

    does anyone have any idea why this is running into this error, run into this before, or know a way around it?

    thank you

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Does the workbook connect to the same instance of SQL Server no matter where it is?

    Most likely the dates in the India version of the Excel program are formatted differently. Ask them what format they are using when they are entering the date. If that matches what you have, you may need to set up a test which simply dumps their input values to a varchar column, and see what converts to a date, and what does not.

  3. #3
    Join Date
    Aug 2015
    Posts
    2
    yes, everyone connects to the same instance. i thought about the dates too but i'm told they enter dates as mm/dd/yy - the dates i have in the sql table are yyyy-mm-dd but that should still translate ok right??

    Quote Originally Posted by MCrowley View Post
    Does the workbook connect to the same instance of SQL Server no matter where it is?

    Most likely the dates in the India version of the Excel program are formatted differently. Ask them what format they are using when they are entering the date. If that matches what you have, you may need to set up a test which simply dumps their input values to a varchar column, and see what converts to a date, and what does not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •