<p>I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:</p>

<pre><code>purchased &gt;= date_sub(now() ,interval 7 day)
</code></pre>

<p>However, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). So basically, throughout the week the results never change, but when someone visits on Sunday morning they will have refreshed.</p>

<p>I just can't get my head around how to work out the days etc. Also, are there built in MySQL functions for doing this?</p>

<p>I hope I've explained that clearly enough.
This is in a PHP application.</p>

MySQL has a
WEEK()
function, that allows you to get the numeric week of the year from a date.  You can get (the week of today) -1, and compare that to the week of your records you are filtering on.