Using Expression Results in another Expression in a View

  • In MS Access, I could create an expression and use its results in another expression very easily but I can't figure out how to do this when I am creating a View in SqlServer2000. For example, col1+col2+col3=subtotal1, col5+col6=subtotal2, (subtotal 1+subtotal2) * taxrate=grandtotal

     

    Could someone please tell me the best way, Thanks

  • You need to spell this out.

    col1+col2+col3=subtotal1, col5+col6=subtotal2, (col1+col2+col3+col5+col6) * taxrate=grandtotal

  • That seems so cumbersome. This means that if the formula for subtotal1 changes, then I have to change the formula for grandtotal also. Why is something that was so easy in Access, so much more complicated in SQL Server?

  • Easy is not equivalent to better

    After all the formulae should not change frequently, or?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply