title: Converting SQL statement to SQL expression field in Crystal Reports
body: <p>I have a SQL statement that pulls data I need but I can't get the syntax right in Crystal Reports. </p>
  
  <p>This statement works in SQL:</p>
  
  <pre><code>SELECT
      max([meter_reading])
  FROM [Forefront].[dbo].[EC_METER_HISTORY_MC]
  WHERE [Meter_Number] = '1' AND [Transaction_Date] &lt; '20130101'
  GROUP BY 
      [Company_Code], [Equipment_Code], [Meter_Number]
  </code></pre>
  
  <p>This is what I changed it to in crystal but I can't get the right syntax.</p>
  
  <pre><code>SELECT     
     Maximum({EC_METER_HISTORY_MC.meter_reading}) 
  FROM [EC_METER_HISTORY_MC] 
  WHERE {EC_METER_HISTORY_MC.Meter_Number} = '1' 
  AND {EC_METER_HISTORY_MC.Transaction_Date}  &lt;  {1?Startdate}
  GROUP BY {EC_METER_HISTORY_MC.Company_Code}
  ,{EC_METER_HISTORY_MC.Equipment_Code}
  ,{EC_METER_HISTORY_MC.Meter_Number}
  </code></pre>