Tuesday, 17 July 2018
MSSQL - Fix Error - The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Watch this example on YouTube
To fix it replace
Select Convert(datetime, '06122018')
with
Select Convert(datetime, Right('06122018', 4) + Left('06122018', 2) +
Substring('06122018', 3, 2))
MSSQL - FIx Error - Divide by zero error encountered
Watch this example on YouTube
Replace
Declare @Number1 int = 1
Declare @Number2 int = 0
Select @Number1 / @Number2
with
Declare @Number1 int = 1
Declare @Number2 int = 0
Select @Number1 / nullif( @Number2, 0)
Subscribe to:
Posts (Atom)