I am having trouble in selecting data from sqlite.
I have stored some tv shows in db, there are 2 columns in my db, show 'start_time' and 'end_time' now i want to select data based on a time slot like if current time is 2 pm than time slot will be 2:00 pm to 2:30 pm, I am able to get shows that are playing in between 2 slots. But between query will not work for the shows that are already started like a show whose start_time is 1 pm and end_time is 3 pm.
EDIT:
I am developing an android app, in which i have to store tv shows for 3 days in sqlite db. Once all data stored in db, i have to show data according to current time slot in listview, time slot is of half hour e.g 1:00 to 1:30 , 1:30 to 2:00, 2:00 to 2:30 etc. I want to show all shows currently playing in the given time slot.
I tried using sqlite between query
SELECT * FROM table_name WHERE start_time BETWEEN 'time_stamp' and 'time_stamp1'
time_stamp is first time of time slot i.e 1:00 from above example
time_stamp2 is second time of time slot i.e 1:30 from above example
This will give me all shows that will start and end in between given time slot.
But if show starts at 12:00 and will end after 2:00 or 3:00 between query will not work in that case
I have also try
SELECT * FROM table_name WHERE start_time<='time_stamp' and end_time>='time_stamp1'.