The problem is that I have to get ids that identify a specific date between a specific time, I've been trying for a few hours but I do not get it, The secret is in the WHERE I've obviously made many unsuccessful attempts . Here the tables
PROGRAMPROGRAM Table
This table contains the days of the week that are valid to play. The "select" should get as important data the column "IDreproduccion"
CREATE TABLE 'programareproduccion' (
'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
'idreproduccion' INTEGER,
'lunes' INTEGER,
'martes' INTEGER,
'miercoles' INTEGER,
'jueves' INTEGER,
'viernes' INTEGER,
'sabado' INTEGER,
'domingo' INTEGER
);
Table PROGRAMPRODUCTIONHORARIES
The column "idprogramacionreproduccion" is an index of the previous table, to the "id" column, the first one.
CREATE TABLE 'programareproduccionhorarios' (
'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
'idprogramacionreproduccion' INTEGER,
'horadesde' TEXT NOT NULL,
'horahasta' TEXT NOT NULL
);
The idea of these tables is to create a schedule of an event where it is triggered in the days and times stored, specifying the day as boolean in the first table and the second the schedules (not dates but time of day) who want to understand within the days specified in the first table. For example: It is requested to run on Tuesdays and Wednesdays. Then Tuesday and Wednesday are true in the first table. And the schedules that comprise them would be from 10 am. until 6:00 pm It would be from 10-00-00 and schedule to 18-00-00. The select that I require has to return the 'idreproduccion' to the one that corresponds at this moment, that is to say now, that is in the database, obviously if there is nothing, of course it will not return anything. Does anyone know more or less? thanks!