3
Good,
I’m having some difficulties in the result of a query. To fit you is the following, I have a registration application of "unavailability." and I need the following:
Every day I have to extract a report from the previous day, but that report must have the following conditions:
Display all "unavailability" in the "Open" state. (Here I have to present)
Display all "unavailability" that have been opened on that day (e.g.: 15/09/2014)
Display all "unavailability" that have been closed on that day (e.g.: 15/09/2014), however at this point the following may happen:
An "unavailability" may have been closed yesterday (15/09/2014) but have been opened day (20/03/2014) but this point the query I have is working well. My difficulty is happening when one of the "unavailability" has not yet been closed and the "dataFim" field is null.
The querys I tried were:
var query = "SELECT * FROM indisponibilidades WHERE estadoIndisponibilidade = 'ABERTO' OR dataInicio = '" + dataPedido + "' OR dataFim = '" + dataFim + "' ";
This works but is also extracting results that have been entered today (16/09/2014) and what the field dataFim is null.
I tried too:
var query = "SELECT * FROM indisponibilidades WHERE estadoIndisponibilidade = 'ABERTO' OR dataInicio = '" + dataPedido + "' OR dataFim = '" + dataFim + "' dataFim is not null; ";
However it makes me export also of all that have been closed today (16/09/2014).
Any idea ?
I was left with one question: You need all the ailments that are open and all that have been opened on the day and all that have been closed on the day or else you need all the ailments that have been opened on the day and that are still open and all that have been closed on the day?
– emanuelsn
I need all the ailments that are open and all that were opened on the day and all that were closed on the day
– Nibbler