 <p>I don't understand what exactly you need, </p> <p>But it seems that you mixed types INT and DATE.</p> <p>So if your <code>in_date</code> field has type <strong>DATE</strong></p> <pre><code>select cust_no, cust_name, sum(bvtotal) as Amount from sales_history_header where cust_no is not null and number is not null and bvtotal &gt; 1000 and in_date &lt; DATE('2014-01-01') group by cust_no,cust_name order by sum(bvtotal) desc; </code></pre> <p>If your <code>in_date</code> field has type <strong>TIMESTAMP</strong></p> <pre><code>select cust_no, cust_name, sum(bvtotal) as Amount from sales_history_header where cust_no is not null and number is not null and bvtotal &gt; 1000 and in_date &lt; TIMESTAMP('2014-01-01 00:00:00') group by cust_no,cust_name order by sum(bvtotal) desc; </code></pre>