Closest Match to timestamp

found a fix that looks like i should of thought of it before!!

SELECT * FROM `history` WHERE `to` LIKE '077777777777' AND `date` <= '2015-06-29 20:03:23' ORDER BY `history`.`date` DESC LIMIT 1