I could solve the problem with SET LANGUAGE For more information about how to use DATEFORMAT with different formats see the "String Literal Date and Time Formats" section in Using Date and Time Data. Some character strings formats, for example ISO 8601, are interpreted independently of the DATEFORMAT setting. It seems that there are some character string formats, that are independent of SET DATEFORMAT. I read the SET DATEFORMAT-article of the Microsoft Help again: I found the solution to the problem with the input of Laszlo Tenki. The strange thing is, that the conversions work on my computer with german-swiss settings, but not on the client-computer, which has a french setup. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON (2) NULL,ĬONSTRAINT PRIMARY KEY CLUSTERED Here is the table definition, it's part of an german ERP system: CREATE TABLE. But I'm still confused and would be glad for answers of you! IF EXISTS (SELECT * FROM sysobjects WHERE name = 'getDateFromString' and type = 'FN')ĬREATE FUNCTION getDateFromString VARCHAR(4), smallint, smallint, smallint) I was able to solve the problem with an own function. I already tried: convert (datetime, RechDatum, 112) This does not work, although the value in the column is 20111019 select I'm getting an error when converting a varchar(8) value to datetime in SQL Server 2005. I need to add days to a varchar representation in the yyyymmdd format.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |