views:

283

answers:

2

I am using the LIST function to create a ';' delimited list of values. The type is numeric (19,2). For some reason the precision appears to be ignored when using the list function. When performing a simple select on this column the values look good, ie "12.00". However, if I use a LIST() my results are of format "12.000000"

This is my LIST usage:

LIST(case when tblWOService.PricePerVehicle is null then ' ' else CONVERT(decimal(19,2),tblWOService.PricePerVehicle end,';')

The CONVERT does not change the result. Any ideas?

Thanks!

+1  A: 

Have you tried explicitly converting your empty string?

LIST(
    case when tblWOService.PricePerVehicle is null then CONVERT(decimal(19,2),' ')
        else CONVERT(decimal(19,2),tblWOService.PricePerVehicle) end,';'
)

I've run into a similar datatype issue with CASE statements in T-SQL.

Harper Shelby
A: 

That was it! Thanks a ton!

Nick