Convert Hijri Shamsi date format tsql -
i want convert hijri shamsi date '92/2/3' format : '92/02/03'
with code, error :the conversion of varchar data type datetime data type resulted in out-of-range value.
declare @str varchar(10) = '92/2/3' select convert(varchar(10), convert(datetime, @str), 111) how can change format of date ?
- since don't have centuries should use
11, not111conversion code you need use 11 in inner convert tell format converting from
declare @str varchar(10) = '92/2/3' select convert(varchar(10), convert(datetime, @str,11), 11)
Comments
Post a Comment