Jump to content

[SOLVED] catching null values


haku

Recommended Posts

With this query:

 

SELECT n.title, n.nid, UNIX_TIMESTAMP(td.deadline) as deadline, td.item_status, td.priority 
FROM {node} as n 
JOIN {to_do} as td 
ON n.vid = td.vid 
JOIN {to_do_assigned_users} as tdau 
ON tdau.vid = n.vid 
WHERE (td.deadline < (CURRENT_DATE() + INTERVAL 7 DAY) OR td.priority = 3) 
AND n.type = 'to_do' AND tdau.uid = 1 AND n.status = 1 AND td.item_status != 2 
ORDER BY deadline 
LIMIT 5, 5

 

Can anyone see why the following query returns values in which td.deadline is NULL? It also doesn't seem to be returning values where td.priority is equal to 3.

 

The following snipped also returns values where td.deadline is NULL:

 

WHERE (td.deadline IS NOT NULL AND td.deadline < (CURRENT_DATE() + INTERVAL 7 DAY) or priority = 3)

 

As does this:

 

WHERE (td.deadline BETWEEN '0000-00-0 00:00:00' AND (CURRENT_DATE() + INTERVAL 7 DAY) or priority = 3)

 

None of them are giving me any luck.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.