Apakah Anda yakin bahwa data yang dimasukkan sebenarnya NULL, dan bukan hanya string kosong?
Setelah itu ganti startPeriod IS NOT NULL
ke TRIM(startPeriod) <> ""
ATAU
query = "SELECT date_format(startPeriod,'%a, %M, %d, %Y') as startDate,
date_format(startTime,'%I:%i%p') as startTime,
date_format(endTime,'%I:%i%p') as endTime,
jobLocation,jobId,
hoursWorked
FROM users,paycheck
WHERE users.userId = '" . $_SESSION['userId'] .
"' AND userId = empId
AND (startPeriod != '0000-00-00' OR startPeriod IS NOT NULL)
ORDER BY paycheck.startPeriod DESC";
semoga ini membantu Anda.