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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 what am i doing wrong here..

Author  Topic 

genic
Yak Posting Veteran

57 Posts

Posted - 2001-05-02 : 13:11:18
ok, the sum part works fine. finding the profileorg, and department works fine...then it gets screwy..

i need to find where the que = 1 AND the task = 1_1 or etc..
ALSO i need to find if the activity = Break-Fix

if its AND b.activity = 'Break-Fix' it does not find anything because its trying to find the que = 1 ..task = to whatever value AND the activity = break-fix. i need to only find the records where the que = 1 and the task = to those values OR the activity = break-fix ...doesnt work though...ideas? i am sure its just the way i am doing it..(reason for the @profileorg is because this is in a SP)

select sum(convert(decimal(10,4), b.hours)) as totalBreakfix from profile as a inner join projecttime as b on (b.profileemail = a.profileemail) where a.profile_org = @profileorg and (b.que = '1' and b.task = '1_1' or b.task = '1_3' or b.task = '1_5' or b.task = '1_7' or b.task = '1_9' or b.task = '1_11' or b.task = '1_13' or b.task = '1_15' or b.task = '1_17' or b.task = '1_19' or b.task = '1_21' or b.task = '1_23' or b.task = '1_25' or b.task = '1_27' or b.task = '1_29') or b.activity = 'Break-Fix'


   

- Advertisement -