 <p>Depending on which type of database you are using (SQL, Oracle ect..);To take the Previous days votes you can usually just subtract 1 from the date and it will subtract exactly 1 day:</p> <pre><code>Where Cast(Posts.modification_date - 1 as Date) = Votes.vote_date </code></pre> <p>or if modification_date is already in date format just:</p> <pre><code>Where Posts.modification_date - 1 = Votes.vote_date </code></pre>