SELECT that is null if there is one more register in this date that is not null
You had one closing parentheses too many in the latter query. You also have columns date and datefin and the distinction between the two is not clear. If you want to do a comparison per day, you have to make sure both rows are from the same day in the inner query (a.date = b.date) and there has to exist b.dateinit where a.dateinit is smaller (&lt;) not smaller or equal (&lt;=). You also erroneously compare datefin columns in the subquery when you should compare dateinit columns. It seems you want to get rows from dates older than 2015-02-27:

SELECT * FROM capturainfo a where date &lt; "2015-02-27" 
AND datefin is null 
AND EXISTS ( SELECT * FROM capturainfo b WHERE a.date = b.date AND a.dateinit &lt; b.dateinit AND a.userid = b.userid )