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

Reputation: 4 Apprentice
Group:
Active Members
Active Posts:
88 (0.05 per day)
Joined:
16-October 09
Profile Views:
2,786
Last Active:
User is offline May 20 2014 07:22 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: Select previous working day

    Posted 20 May 2014

    I thought of another way around this, but that didn't work either :(
    The report database is refreshed overnight, and as long as there are no transactions over the weekend, I thought I could cast OrderDate as an integer, then return rows where there was a max value:
    max(cast('OrderDate' as integer))
    

    This didn't work though, as it complained about an aggregate not being permitted in a WHERE clause unless it is a subquery contained in a HAVING clause. Playing around with HAVING didn't get me anywhere either :(
  2. 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!
  3. 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!!
  4. 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) :(/>
  5. 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

My Information

Member Title:
D.I.C Head
Age:
31 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