Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

VREntropy

@VREntropy
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • New Car
    V VREntropy

    Not a 50's MG, but I DO have a '64 MGB I pulled from the barn I parked her in 20 years ago. http://farm7.staticflickr.com/6102/6290712858_7669610cfc_z.jpg[^] There is a full set of pics showing the poor old girl here[^] I cannot wait to re-tune the Strombergs. :doh:

    The Lounge xml question

  • Mmmm, BACON Nativity
    V VREntropy

    Frickity Frackity Fruss! If I go to the second link, THEN the first one works (on a new machine) but otherwise the first one does not. Sometimes WordPress can be such a pain in the 7th planet from the sun. :mad:

    The Lounge com

  • Mmmm, BACON Nativity
    V VREntropy

    I searched. Didn't see it. Thought it needed sharing.

    if (Post == rePost){accept = downvote};

    The Bacon Nativity, ready to pop in the oven for that annual feast: http://whyismarko.com/wp-content/uploads/2010/12/meat-nativity.jpg[^] and if you wanna see all of the horrible nativities, here is the main link. (I personally love the Godzilla one.) :rolleyes: http://whyismarko.com/2011/27-worst-nativity-sets-the-annual-growing-list/[^]

    The Lounge com

  • Trying to get Pivot Table working in MS SQL 2005
    V VREntropy

    Thanks. Somehow I had missed that article. It does give a shove in the right direction. So far we have built a temp table instead. Maybe that can be made cleaner. :) Don

    Database database question help

  • Trying to get Pivot Table working in MS SQL 2005
    V VREntropy

    I have never used a pivot before and I am starting to think that one doesnt work. Please help provide guidence. I have 3 tables _Contracts, which contain contractid and sepworkstatus _contracts -------------------- 1,[Sent] 2,[Sent] 3,[No Further Action] _vendors which has umbrellaname and vendornumber _contracts.vendorid is foreign to _vendors.vendornumber _vendors --------------------- um1,1 um2,2 um2,3 and _UmbrellaData which has umbrellaname and a few other needless columns. umbrellaname connects _UmbrellaData and _vendors _UmbrellaData --------------------- um1 um2 The outer apply will grab a list of all the statuses and their counts for each umbrella company The results will look similar to um1,sent,1 um2,No Further Action, 1 um2,sent,1 um3,Executed my output needs to look like this umbrellaname, sent, [No Further Action], [Executed] um1,1,null,null um2,1,1,null My current query looks like this select u.umbrellaname, u.stream, functionalarea, [In Negotiation],[Prework Complete],[Sent],[No Further Action],[Executed],[Separation Work Started],[Ready to Send],[Prework Started] from dbo._UmbrellaData u outer apply ( select v.umbrellaname, c.sepworkstatus, count(c.sepworkstatus) as counte from dbo._Vendor v join dbo._Contracts c on c.vendorid = v.vendornumber group by v.umbrellaname, c.sepworkstatus ) as oa pivot(max(oa.counte) for oa.sepworkstatus in ( [In Negotiation],[Prework Complete],[Sent],[No Further Action],[Executed],[Separation Work Started],[Ready to Send],[Prework Started] )) as cw where oa.umbrellaname = u.umbrellaname Unfortunately when I run it I get the following errors. Msg 8156, Level 16, State 1, Line 2 The column 'umbrellaname' was specified multiple times for 'cw'. Msg 4104, Level 16, State 1, Line 2 The multi-part identifier "oa.umbrellaname" could not be bound. Msg 4104, Level 16, State 1, Line 2 The multi-part identifier "u.umbrellaname" could not be bound. Msg 4104, Level 16, State 1, Line 2 The multi-part identifier "u.umbrellaname" could not be bound. Msg 4104, Level 16, State 1, Line 2 The multi-part identifier "u.stream" could not be bound. Why? How do I get a pivot to work with an outer apply? Any help on this would be greatly appreciated.

    Database database question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups