sql - Error selecting rows where decimal > 0 -
i keep getting error:
msg 8114, level 16, state 5, line 1 error converting data type varchar numeric.
when executing query:
select a.emplid, a.empl_rcd, a.dz_presence_type, a.dz_date, a.dz_time_hours ps_dz_time_vw a.dz_presence_type in ('p50', 'forf') , a.dz_time_hours > 0
a.dz_time_hours
decimal value, when execute query without 'and a.dz_time_hours > 0'
query runs fine , returns values 0.00000
or 3.11400
. goal display values above 0.
edit: forgot add exec sp_help ps_dz_time_vw
tells me a.dz_time_hours
decimal type length 5, prec 7 , scale 5.
try forcing casting? (you may need specify length precision\scale etc) :
cast(a.dz_time_hours decimal) > 0
just noticed collation. seems unfamiliar me. have affect different datatypes treated differently depending on local. decimal\varchar issues seems weird...
Comments
Post a Comment