sql - Positive values from Datediff without using ABS -
case 1 = 1 isnull(convert(varchar,datediff(day, date1, date2)),'')
i need have positive
values difference, when use abs
wont work varchar
type. need empty string
null values
.
why converting varchar()
? actually, question looks vaguely familiar, , think warned using varchar()
without length in sql server.
if need value string , positive, conversion after abs:
coalesce(cast(abs(datediff(day, date1, date2)) varchar(255)), '')
Comments
Post a Comment