title: How do I split a database column in to separate, query-able values?
body: <p>I have no idea how to do this query. I need to grab a bunch of information, but it's all in one column. If the table rotated 90 degreses to the right it'd be just fine... lol...</p>
  
  <p>The ObjectInternalID column represents one event.<br>
  <strong>Conditions</strong><br>
  I want all event(s) details(Values Column)<br>
  only for one person <code>where values = "his name"</code><br>
  within a specific date range <code>where values &gt; "date range"</code></p>
  
  <p>Any idea what the easiest way to do this is? </p>
  
  <p><a href="https://i.stack.imgur.com/p1vqC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p1vqC.png" alt="enter image description here"></a></p>
  
  <p><strong>PROGRESS UPDATE</strong></p>
  
  <p>I'm trying to create a temp table out of this, but I get issues when I add the <code>into</code> statement. </p>
  
  <pre><code>select 
      s.ObjectInternalID
      , MAX(Case when UserDefinedFieldInternalID = 3 then Value end) as date1
      , MAX(Case when UserDefinedFieldInternalID = 4 then Value end) as resident1
      , MAX(Case when UserDefinedFieldInternalID = 66 then Value end) as attending1
      , MAX(Case when UserDefinedFieldInternalID = 14 then Value end) as date2
  into 
      #TempQueryTable(
       MAX(Case when UserDefinedFieldInternalID = 3 then Value end) as date1
      , MAX(Case when UserDefinedFieldInternalID = 4 then Value end) as resident1
      , MAX(Case when UserDefinedFieldInternalID = 66 then Value end) as attending1
      , MAX(Case when UserDefinedFieldInternalID = 14 then Value end) as date2
  from 
      DocUserDefinedData s
  group by 
      s.ObjectInternalID
  </code></pre>
  
  <p>If I comment out the into section, it runs, but otherwise I get an "incorrect syntac ',' error. I don't see </p>