Try it and see if it works.

On a design note though, why would you want to store a computed field
in a database.  This is a waste of storage space.  Review your design
to see if there is a better way to do this.

On Sep 15, 11:26 pm, Carnage <[email protected]> wrote:
> Can you perform logic directly with Parameters in a SQL Query?
>
> Simple example would be something like This.  You have a database
> based on orders for Oranges, Apples, and Pears.  A User will input the
> Values for the three types of fruit and you want a fourth field
> "Total_Fruit" to be filled in automatically.
>
> Would Something like...
>
> ' Update Orders set Oranges = @Oranges, Apples = @Apples, Pears =
> @Pears, Total_Fruit = (@Oranges + @Apples + @Pears) where OrderID =
> @OrderID" work?  Or do you have to manipulate the logic using a
> script?  Or is there a completely different way to do something like
> this that is generally better?

Reply via email to