Reputation: 4 Apprentice
- Active Members
- Active Posts:
- 86 (0.05 per day)
- 16-October 09
- Profile Views:
- Last Active:
- Jan 17 2014 02:42 AM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Dream Kudos:
26 Aug 2011 - 06:51
Posts I've Made
Posted 13 Jan 2014Did you mean header status or item status? As, header status is either 'Active' or 'Inactive', and item status is 'Open' or 'Closed'?
Off home now, will pick this up tomorrow. Thanks again for your help!
Posted 13 Jan 2014Whoa, hold the phone!!
Flipping the 0 & 1 in the CASE WHEN seems to have done the trick! So:
select HeadGUID from Item group by HeadGUID having sum(case when Status='Closed' then 0 else 1 end)=0
Gonna check through the data, but we could be onto a winner!!
Thanks very much!!
Posted 13 Jan 2014Ok, if I lose the "dbo." at the start of the "join name", and also on the right side of the join, it returns data! But....it still looks like the wrong data (Foo, in this case) />
Posted 13 Jan 2014Doh, I was sure that would have cracked it, but now it throws a syntax error
QuoteLine 4: Incorrect syntax near '.'
Line 4 is the sub-select line....I'm going to play a bit more to see if it occurs as a select on its own
Posted 13 Jan 2014Thanks for the replies all - obviously this was example/pseudo code...the Header/Head mix-up was just a typo!
Unfortunatly, the status fields aren't actually numerical or even bool - they are strings! This rules out the sum route
Modi's solution looks good, but doesn't work for some reason (it too, returns "Bar"). I'm going to dig into the data manually and look for reasons why. In the live environment, there are over 20000 records, with 1000s in each combination, so I have to figure out this script somehow!
Thanks for the input so far anyway, I'm going to play around a bit and see what I can find
- Member Title:
- D.I.C Head
- 30 years old
- August 31, 1983
- Portsmouth, UK
- Programming Languages:
- Website URL:
chemicalfan hasn't added any friends yet.