I couldn’t find a real answer anywhere so I am asking.
Here is my query
("SELECT * FROM messages WHERE message_date < ? AND message_date //not greater than// ? AND to_user = ? OR from_user = ? ORDER BY message_date DESC")
I have no idea how to check that the date is not greater than the defined date
There’s two ways to write it.
One option is to simply use
<=since “not greater than” is equivalent to “less than or equal to.”The other is to use the
NOTmodifier, e.g.... AND NOT (message_date > ?).