title: Summing only if a certain customer in MS Access 2003
body: <p>I wanted to use a case statement (not recognised by MS Access) but this is what I have instead:</p>
  
  <pre><code>Sum(if [Time Report].Cust_id=2
                            then ([Time Report].[Hrs P1]) 
                            ELSE 0 END IF) AS [SumOfHrs P1],  
  Sum(if [Time Report].Cust_id=2
                            then ([Time Report].[Hrs P2]) 
                            ELSE 0 END IF) AS [SumOfHrs P2], 
  Sum(if ([Time Report].Cust_id=2 )
                            then ([Time Report].[Hrs P3]) 
                            ELSE 0 END IF) AS [SumOfHrs P3], 
  </code></pre>
  
  <p><em>etc.</em>
  <br>What I want is a new table with just the summaries of the 'Pn's for cust_id = 2
  With this sort of layout</p>
  
  <pre><code>Name    P1    P2    .....
  Bob     0.23  0.45
  </code></pre>
  
  <p>But I get the error message <code>Syntax error (missing operator) in query expression 'query'</code>, and then it highlights the <code>THEN</code> part of my query.</p>
  
  <p>Whats gone wrong?</p>
  
  <p>P.s: Writing the sql in anything but access 2003 is not going to be possible unfortuantely.</p>