The query needs to do exactly what it says. Get all Tests of a specific date and time. Also if i just run the query manually on the database it does not work, so it doestnt really matter where its generated.
I appreciate the time you put into answering my questions (you obviously enjoy it) Im off for now, i might tackle the problem again tomorrow and let you think about it untill then if you still want to help me out.