I have a table of items, each of which has a date associated with it. If I have the date associated with one item, how do I query the database with SQL to get the \'previous
If your RDBMS supports LAG and LEAD, this is straightforward (Oracle, PostgreSQL, SQL Server 2012)
These allow to choose the row either side of any given row in a single query