MySQL: Select with first and last day of previous month
<p>Using PhpMyadmin, I have this sentence working:</p>

<pre><code>SELECT id_order as Ref FROM t_orders WHERE DATE(invoice_date) = CURDATE()
</code></pre>

<p>Now I want to reemplace "current date" (CURDATE) for the first day of previous month in advance.</p>

<hr>

<p>The answer of Ankit Bajpai solved my problem (thank you):</p>

<pre><code>SELECT id_order as Ref FROM t_orders WHERE DATE(invoice_date) &gt;= concat(date_format(LAST_DAY(now() - interval 1 month),'%Y-%m-'),'01'); 
</code></pre>