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!

Case funtion

Status
Not open for further replies.

danarashad

Programmer
Nov 2, 2006
115
US
select fname,lname,ID,
(select sum(cast(pointsappr as INTEGER)) from proff p where D.ID=P.userid and p.show_name='1. College Course Graduate Level') as total
from Demographics d
order by ID
I am getting an error, when i run this, what am i doing wrong. if i take out the (cast as integer) it works, but i need to cast this as a number.
 
Try (CAST pointsappr AS INT).

Also, where is the table that's aliased as "P"? I don't see it in your query.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the amnesiac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top