I've got a table which has the following columns:
- show_days_before_start (integer)
- start_time (DATETEXT)
The purpose of the "show_days_before_start" column is to add the days onto the "start_time" to determine when the record should start appearing in results (if it's outside of this time then it should not be shown) (this column could have value from 7 to 21), and the "start_time" is just a datetime stamp of when the event the record is referring to starts.
I need a query to do the above and to return the relevant records. What is the best way to approach this in terms of query design?