<p>I'm using MySQL in particular, but I'm hoping for a cross-vendor solution.  I'm using the NOW() function to add a timestamp as a column for each record.</p>

<pre><code>INSERT INTO messages 
(typeId, messageTime, stationId, message) 
VALUES 
(?, NOW(), ?, ?)
</code></pre>

```
```
SELECT * FROM messages WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= messageTime
```
```