Rails ActiveRecord/SQL Query - best practise
I'm got a table of 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), 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.

Any help/advise is much appreciated.
Rails ActiveRecord/SQL Query - best practise
===

I'm got a table of 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), 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.

Any help/advise is much appreciated.