Reputation: 231
is their any query to pick certain date between two time stamps?The Problem is these two times stamps are set in two diffrent fields
Upvotes: 0
Views: 70
Reputation: 37093
Try this:
SELECT *
FROM table
WHERE fs_from > 'some date'
AND fs_to < 'some other date'
Upvotes: 1
Reputation: 829
In my opinion you can try in this way (If I really understood your question)
SELECT myFields FROM myTable
WHERE myCertainDate BETWEEN fs_from AND fs_to
Upvotes: 1
Reputation: 1271003
Which date do you want? You can choose a random date by doing:
select t.*,
date_add(t.fs_from, interval cast(datediff(fs_to, fs_from) * rand() as int) day
) as ArbitraryDateBetweenTwoDates
from table t
Upvotes: 0
Reputation: 522
SELECT * FROM table WHERE fs_from > theDate AND fs_to < theDate;
I suggest to use prepared statements and insert a date object into the query.
Upvotes: 1