Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 where is the error in this sql code?

Author  Topic 

Trininole
Yak Posting Veteran

83 Posts

Posted - 2009-07-20 : 15:02:05
I am trying to look to find and see where the error is in this code?


select distinct c.col_username
,c.col_caseid
,cp.col_participationdate
,cp.col_programid
,indo.dob
,co.col_exitdate
,datediff(yy,indo.dob,getdate()) >='55' as age
from tbl_case c, tbl_caseparticipation cp, indeeo indo,
tbl_caseoutcome co
where datediff(yy,indo.dob,getdate()) >='55'
and c.col_username=indo.username
and c.col_caseid=cp.col_appid
and c.col_caseid=co.col_idnum

Roger DeFour

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-20 : 15:11:31
Drop the ">= 55" in this line

,datediff(yy,indo.dob,getdate()) >='55' as age



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-21 : 03:21:45
quote:
Originally posted by Trininole

I am trying to look to find and see where the error is in this code?


select distinct c.col_username
,c.col_caseid
,cp.col_participationdate
,cp.col_programid
,indo.dob
,co.col_exitdate
,datediff(yy,indo.dob,getdate()) >='55' as age
from tbl_case c, tbl_caseparticipation cp, indeeo indo,
tbl_caseoutcome co
where datediff(yy,indo.dob,getdate()) >='55'
and c.col_username=indo.username
and c.col_caseid=cp.col_appid
and c.col_caseid=co.col_idnum

Roger DeFour


What is the error you are getting?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -