Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 math function

Author  Topic 

u2p_inst
Yak Posting Veteran

78 Posts

Posted - 2002-12-26 : 05:34:48
i have table like this:
columnA ColumnB
2 4
5 7
7 7

i want to make the table like this

columnA columnB (columnA*3)/columnB
2 4 1.5
5 7 2.14
7 7 3
is posible?

oh

fire1
Starting Member

5 Posts

Posted - 2002-12-26 : 08:04:54

select columnA,columnB,1.0*columnA*3/columnB from table

or

select columnA,columnB,str(1.0*columnA*3/columnB,8,2) from table

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-26 : 18:59:39
If you want to add a computed column to your table

ALTER TABLE MyTable
ADD columnC As (columnA*3)/columnB

Make sure you have the latest service pack.

Go to Top of Page
   

- Advertisement -