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
 General SQL Server Forums
 New to SQL Server Programming
 how to put formula in sql filed

Author  Topic 

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2007-04-18 : 02:18:13
i have two tables .Table 1 contains certain columns with values.Table 2 shud get those data from table1 into its column and display the calculated result. Any idea how do i go abt it,bcuz table2 shud contain a formula so as to calculate.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-18 : 02:32:26
Care to share any examples?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2007-04-18 : 02:38:55
Table 1
A B
1 2

Table 2
C
(A+B)=3

Table 1 has 2 colums A & B with values, and table 2 column C shud contain the result of A+B ie 1+2=3
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-18 : 03:21:17
How do you connect the two tables?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2007-04-18 : 03:31:44
thats wht iam asking how do i go on implementing this problem.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-18 : 03:33:59
In table 1, you should have a primary key.
In table 2, you should have a column referencnig to which record in table 1 the formula should evaluate.

TABLE1
------
ID A B
1 1 2

TABLE2
------
ID C
1 A + B


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -