Results 1 to 4 of 4

Thread: User Profile Problem - Not machine Specific?

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    User Profile Problem - Not machine Specific?

    I have a user that is getting the following SQL exception when trying to run a stored procedure that has a date parameter as input:
    "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."

    The interesting thing is that any machine that this user logs into and runs the application the same thing happens. It only happens to this user. But someone else can log into the same machine and it works fine.

    Is there some master NT profile that is set up within the domain that might be causing this?

    Any help or suggestions would be greatly appreciated.

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Strange indeed... could you post the code?

    Certainly people can set up their culture-specific time information... as you do in Control Panel, Regional Language Options.. never realized it was specific to the user though.

  3. #3

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Maybe it is a regional setting on the SQL Server for this persons login? My thought was that the month and day in the date format was being thrown off because the users regional settings were different than English. The stored procedure is:

    VB Code:
    1. CREATE PROCEDURE dbo.xxxxx
    2.     (
    3.         @customernum    as integer,
    4.         @sometype   as char(1),
    5.         @startdate      as datetime,
    6.         @anothertype    as char(2),
    7.         @numweeks       as integer
    8.     )
    9.  
    10. AS
    11.  
    12. Set NoCount On
    13.  
    14. if @numweeks != 0
    15. begin
    16.    select @startdate = DATEADD(wk,-@numweeks,{ fn curdate()})
    17. end
    18.  
    19. select x, y, z
    20.   from sometable
    21.  where CustomerNum = @customernum
    22.    and Sometype = @sometype
    23.    and Anothertype = @anothertype
    24.    and xDate >= @startdate
    25. order by xDate desc
    26. GO

    I have verified that the format of the date being passed in is dd/mm/yyyy 12:00:00 AM, which should be ok.



    Any ideas?

  4. #4

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Ah, I have found the problem at last!

    If anyone is interested, it was that the users login in the SQL Server had the default language set to Italian instead of English! Having limited access to the database (not being able to see this information) made it a bit harder for me to solve

Posting Permissions

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



Click Here to Expand Forum to Full Width