I need to convert [Date and Time Style][1] from USA format to German and than cast that into `int` data type. So for variable in case below this works fine if I want to display it in Standard 112 (ISO) DECLARE @LoopDate datetime SET @LoopDate = '12/23/2015' SELECT @LoopDate AS Original, CAST(CONVERT(VARCHAR(8), @LoopDate, 112) AS int) AS int; But when I put 104 which suppose to gives me error: > Conversion failed when converting the varchar value '23.10.2015' to > data type int. It looks like conversion is actually working but casting into `int` is not. [1]: https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-2017#date-and-time-styles