Hi,I've a variable in my SP that I'd like to use to change the format of my output. Try this!select case when 1=2 then cast(1 as decimal(10,2)) else cast(2 as decimal(10,0)) endThen this:select case when 1=1 then cast(1 as decimal(10,2)) else cast(2 as decimal(10,0)) endCan anyone help me understand (and address) why in either case, the output is returned as n.nn ? Whilst single select expressions (like these): select cast(1 as decimal(10,2)) -- = 1.00select cast(2 as decimal(10,0)) -- = 2Work fine. Ah well. Perhaps there is another way...Regards Greg.
↧