4
4
4itosik2015-03-03 17:49:56
SQL
4itosik, 2015-03-03 17:49:56

How to create a query from a database with a time interval?

Good afternoon!
Essence of the question:
in the rails application in the model there are 2 columns in the database start_time (time), end_time (time)
There is a search block where it is possible to specify the start time and end time.
actually the question is how to sample only those data that fall within a given interval?
Thank you!
where("start_time >= ? and end_time <=?", start_time, end_time) doesn't help. a lot of extra stuff :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-03-03
@alexey-m-ukolov

If you have something superfluous displayed, apparently, you need to supplement the filter with some conditions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question