I’m working on an attendence log, where I am using:
$sql="SELECT date FROM daily_entry_log_2011 WHERE logout_time > '16:30:00' AND
logout_time < '18:30:00' AND date BETWEEN '".$firstdt."' AND '".$lastdt."'
AND empid = '".$eid."'";
How can I check if logout_time is NULL in this query?
It really is not clear what you are exactly wishing to do. To test nullability use the
IS NULLsyntax : http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_is-nullThe logout time can not both be ’18:30:00′ and null at the same time, so to hazard a guess, you are wanting