Simon Gare wrote:
Hi,
would like to calculate field based on the entry in another i.e.;
field3 = field2 X field1
field1 field2 field3
10 2.5 25.00( =sum(field1*field2))
sum? you want an aggregate? if so, you can't show the details ...
Or are you thinking that you have to use sum() to do any calcualtion? if so,
that is not the case
How do I go about this in the SQL DB itself, can it be done within
field3?
It depends on the version of the database you are using (I assume it's SQL
Server ... never ask a database-related question without full specifying the
type and version of the rdbms you are using - it's almost always relevant)
In SQL7, your only option would be to create a view. Assuming you don't want
an aggregate:
CREATE VIEW MyView As
Select field1,field2,field1*field2 As Result
From table
In SQL 2000+, you have other options which I suggest you investigate either
by reading about them in Books Online or by posting to one of the sqlserver
newsgroups on this news server.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"