Hey,
I have a table which I'm selecting based on a date_sub:
Code MySQL:SELECT private_messages.toID, private_messages.fromID, private_messages.currentDate, private_messages.type, customers.name, customers.lname FROM private_messages INNER JOIN customers ON customers.id = private_messages.fromID WHERE toID =70 AND private_messages.currentDate < DATE_SUB(CURRENT_TIMESTAMP , INTERVAL 5 DAY) AND private_messages.currentDate > DATE_SUB(CURRENT_TIMESTAMP , INTERVAL 6 DAY
Which returns:
70 167 2009-12-30 09:21:20 PM Ben L
70 102 2009-12-30 10:20:01 PM Jay Esco
70 102 2009-12-30 10:37:09 PM Jay Esco
70 102 2009-12-30 10:37:15 PM Jay Esco
70 102 2009-12-30 10:37:17 PM Jay Esco
70 102 2009-12-30 10:37:53 PM Jay Esco
When I change the INTERVAL to
Code MySQL:AND private_messages.currentDate < DATE_SUB(CURRENT_TIMESTAMP , INTERVAL 4 DAY) AND private_messages.currentDate > DATE_SUB(CURRENT_TIMESTAMP , INTERVAL 5 DAY
It returns
70 167 2009-12-30 09:21:20 PM Ben L
Which is also part of the 5 - 6 INTERVAL. So in essence its duplicating the data. What I'm trying to accomplish is to grab from a certain day and only that day (nothing before nothing afterwards).
I'm not sure where I'm going wrong?![]()









Bookmarks