I have a table (jobs) that I am trying to query specific jobs in a time range. The hard part that I am hitting is that the job stream runs over the date change (00:00). So when I am putting in the date I want to see the job stream for, and I enter (for example) 2014-02-11, the logic searches for the job name that was started on the day before what was entered (because the job stream runs over the date change), and then get's all the jobs that run in between there and the end job (on the actual date that was entered in). I have written this query:
SELECT job_name, job_start_time, job_end_time
FROM job WHERE (job_start_time LIKE '2014-02-10%' AND job_name = 'start')
AND (job_end_time LIKE '2014-02-11%' AND job_name = 'end')
ORDER BY job_end_time ASC;
I can do this programatically in java and parse out the extra non-job stream related jobs, but I'd rather hit the database once and just have the data there that is needed. I thought about trying an inner select, but from everything that I have read, #1, they can be costly and #2 are usually more expensive than a single select.
The above query is returning 0 results and I'm at a loss of what I did wrong.