Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selected Expressions???

Status
Not open for further replies.

hussux

Programmer
Jan 11, 2001
19
GB
HELP!!! I need to calculate two fields together in a SP bearing in mind that the formula's could get v.big!


Simple Example of the problem...

CREATE PROCEDURE myproc AS
SELECT
f1,
f2,
f1+f2 as f3,
f3+f1 as f4
FROM t1
GO

I need to add together f3 and f1 to equate f4

Please Help!


 
What is f3? You have it defined both as a column of t1, and as an expression f1+f2. Malcolm
 
I think you are going to have to go the long way around on this one:

SELECT f1, f2, f1 + f2 as f3, 2*f1 + f2 f4 FROM t1;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top