Description:
When I do a select comparing a DATETIME field using curdate(), the MySQL returns only the records before a NULL value in the field. No ones records is returned after the NULL Value ...
Example:
mysql> select ticket, cliente, dataentrada from ticket;
+--------+-------------+---------------------+
| ticket | cliente | dataentrada |
+--------+-------------+---------------------+
| 1 | 34094265821 | 2008-07-04 11:23:25 |
| 2 | 34094265821 | 2008-07-04 11:26:02 |
| 3 | 34094265821 | 2008-07-04 11:12:21 |
| 4 | 34094265821 | 2008-07-04 11:31:14 |
| 5 | 34094265821 | 2008-07-04 11:23:25 |
| 6 | 34094265821 | 2008-07-04 11:26:20 |
| 10 | 34094265821 | 2008-07-04 11:08:12 |
| 11 | 34094265821 | 2008-07-04 11:26:25 |
| 12 | 34094265821 | 2008-07-04 11:26:25 |
| 13 | 34094265821 | 2008-07-04 11:26:25 |
| 14 | 34094265821 | 2008-07-04 11:26:25 |
| 15 | 34094265821 | 2008-07-04 11:26:25 |
| 16 | 11075796865 | 2008-07-04 11:26:25 |
| 17 | 11075796865 | NULL |
| 18 | 11075796865 | 2008-07-04 11:26:25 |
| 19 | 11075796865 | 2008-07-04 11:26:25 |
| 20 | 11075796865 | 2008-07-04 11:26:25 |
| 21 | 11075796865 | 2008-07-04 11:26:25 |
| 22 | 00000001617 | 2008-07-04 11:26:25 |
| 23 | 11075796865 | 2008-07-04 11:26:25 |
| 24 | 00000001623 | 2008-07-04 11:26:25 |
| 25 | 00000001621 | 2008-07-04 11:26:25 |
| 26 | 00000001626 | 2008-07-04 11:26:25 |
| 29 | 00000001625 | 2008-07-04 11:26:25 |
| 30 | 00000001621 | 2008-07-04 11:26:25 |
| 31 | 00000001623 | 2008-07-04 11:26:25 |
| 32 | 00000001621 | 2008-07-04 11:26:25 |
+--------+-------------+---------------------+
27 rows in set (0.00 sec)
Now , I will make a comparation using curdate == Today is 04-07-2008 ==
mysql> select ticket, cliente, dataentrada from ticket where date(dataentrada) =
curdate() ;
+--------+-------------+---------------------+
| ticket | cliente | dataentrada |
+--------+-------------+---------------------+
| 1 | 34094265821 | 2008-07-04 11:23:25 |
| 2 | 34094265821 | 2008-07-04 11:26:02 |
| 3 | 34094265821 | 2008-07-04 11:12:21 |
| 4 | 34094265821 | 2008-07-04 11:31:14 |
| 5 | 34094265821 | 2008-07-04 11:23:25 |
| 6 | 34094265821 | 2008-07-04 11:26:20 |
| 10 | 34094265821 | 2008-07-04 11:08:12 |
| 11 | 34094265821 | 2008-07-04 11:26:25 |
| 12 | 34094265821 | 2008-07-04 11:26:25 |
| 13 | 34094265821 | 2008-07-04 11:26:25 |
| 14 | 34094265821 | 2008-07-04 11:26:25 |
| 15 | 34094265821 | 2008-07-04 11:26:25 |
| 16 | 11075796865 | 2008-07-04 11:26:25 |
+--------+-------------+---------------------+
13 rows in set (0.00 sec)
Where is my Records??????????
27 rows - 1 row(NULL) = 13 rows ??????????????????????????????
In the second query, Its should return 26 Rows !! Not only 13 Rows.
How to repeat:
Every TIme