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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

views and max aggreage function 1

Status
Not open for further replies.

GCM06

Programmer
Mar 21, 2006
10
0
0
CA
Hi guys, I am trying to do have the following functions in a view
-2.49416 + AGE + max(FTPSA - 0.065867907, 0)**3 - 355.52143
I have the following but it generates an error, any ideas?

CREATE VIEW dbo.Calc
AS
select LoginName,( ResultAny) As Prob
from
(select LoginName,
(-2.49416 + AGE + power(max(PSA - 3.247),3 )- 355.52143 )
AS ResultAny

from
(
SELECT LoginName, AGE,EB,IPSS,PSA,FTPSA, ptFH =
CASE
WHEN FH='Y' THEN 1
WHEN FH ='N' THEN 0
END,
'ptdre' =
CASE
WHEN DRE = 'Y' THEN 1
WHEN DRE = 'N' THEN 0
END

FROM dbo.Probability)
Calc)Calc


Thanks in advance,
Greta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top