I have a View that multiplies a decimal (8,5) data type * money data type (no cast or convert) and for some odd reason comes up with a bit result (0 or 1). If I take the select statement out of the View, paste it into Query analyzer and execute it I get a decimal result.
It's easy enough to put a cast into the view but I'm wondering what is going on in the view that returns the bit data type.Huh? Post the code and sample data, please.|||I don't see that happening.
set nocount on
create table test1
(col1 decimal (8, 5),
col2 money)
insert into test1 values (30.2, .6)
insert into test1 values (20.0, 1.5)
go
create view test11
as
select col1 * col2 as prod, col1, col2
from test1
go
select *
from test11
go
drop view test11
drop table test1
No comments:
Post a Comment