chemicalfan's Profile User Rating: -----

Reputation: 4 Apprentice
Group:
Active Members
Active Posts:
86 (0.05 per day)
Joined:
16-October 09
Profile Views:
2,679
Last Active:
User is offline Jan 17 2014 02:42 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Volkswagen
Dream Kudos:
0

Latest Visitors

  • PhotoHiram Icon
    26 Aug 2011 - 06:51
Icon   chemicalfan has not set their status

Posts I've Made

  1. In Topic: SQL select query help!

    Posted 13 Jan 2014

    Did 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!
  2. In Topic: SQL select query help!

    Posted 13 Jan 2014

    Whoa, 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!!
  3. In Topic: SQL select query help!

    Posted 13 Jan 2014

    Ok, 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) :(/>
  4. In Topic: SQL select query help!

    Posted 13 Jan 2014

    Doh, I was sure that would have cracked it, but now it throws a syntax error :(

    Quote

    Line 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
  5. In Topic: SQL select query help!

    Posted 13 Jan 2014

    Thanks 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

My Information

Member Title:
D.I.C Head
Age:
30 years old
Birthday:
August 31, 1983
Gender:
Location:
Portsmouth, UK
Programming Languages:
Python

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Friends

chemicalfan hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    Hiram Icon

    26 Aug 2011 - 06:51
    Always good to see a fellow Arch user! :3
Page 1 of 1