So sorry if the wording of my question is vague, but I couldn't think of how else to phrase it.
I have a table of data that includes a date field and a shift field (1, 2 or 3). Assuming a given row is currently selected, I want to be able to query this table for the previous and next record. If that's not clear enough, if the current record is date = 2018-08-13 and shift = 1, the previous record would be 2018-08-12 shift 3. I'm almost to the point of adding a field to the table that has the date and shift concatenated, but there's GOT to be a better way! (The database engine should be immaterial, but I'm using JavaDB.)