troubleshooting Question

Getting results from a a qry.

Avatar of indy500fan
indy500fan asked on
Microsoft SQL ServerMicrosoft SQL Server 2005
4 Comments1 Solution238 ViewsLast Modified:
Friends,

I have a qry that isn't quite working.  

Here is my qry (thanks to a modification to a solution provided by angelIII -- thanks again!):

Select st.ResultItemID, st.SectionTime
from SectionTimes st
where SectionID=-1
and SectionTime > -1
and RunID=38
and sectiontime in (Select Sum(SectionTime) From SectionTimes i Where
i.ResultItemID = st.ResultItemID
and RunID=38
and SectionID=-1
and SectionTime > -1
 )

Now, there are 24 ResutItemID s for RunID 38; however no results show up when I run this qry.  What's wrong with the qry.  If I run the qry below, I get a result:

Select Sum(SectionTime) From SectionTimes Where
ResultItemID = 17
and RunID=38
and SectionID=-1
and SectionTime > -1

If that's the case, shouldn't I be getting results in the big qry?

Thanks in advance!

Regards,
Eric
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros