Results 1 to 3 of 3

Thread: data conversion

  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: data conversion

    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.
    Thanks,
    Bill

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Huh? Post the code and sample data, please.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    I don't see that happening.
    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •