liamloveslearning Posted May 27, 2010 Share Posted May 27, 2010 Hi everyone, I need to select rows from my database where intradelete = 1 and between 2 sets of dates only its selecting everything, the intradelete = 1 doesnt seem to be working, can anybody see why? heres my query SELECT * FROM worksorders WHERE worksorders.intradelete = 1 BETWEEN '$startdate' AND '$enddate' and heres my startdates <?php $startdate = date('Y-m-d', strtotime ("last Sunday")); $enddate = date('Y-m-d', strtotime ("next Friday")); ?> Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/ Share on other sites More sharing options...
-Karl- Posted May 27, 2010 Share Posted May 27, 2010 SELECT * FROM worksorders WHERE worksorders.intradelete = '1' BETWEEN '$startdate' AND '$enddate' Maybe? Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064119 Share on other sites More sharing options...
liamloveslearning Posted May 27, 2010 Author Share Posted May 27, 2010 No luck, its strange Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064120 Share on other sites More sharing options...
liamloveslearning Posted May 27, 2010 Author Share Posted May 27, 2010 Ive tried removing the filter between dates and just selecting where intradelete = 1 but its still not working, i really cant understand it Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064121 Share on other sites More sharing options...
kenrbnsn Posted May 27, 2010 Share Posted May 27, 2010 What field is between those dates? You're not telling MySQL that. ELECT * FROM worksorders WHERE worksorders.intradelete = 1 and somefield BETWEEN '$startdate' AND '$enddate' Ken Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064122 Share on other sites More sharing options...
liamloveslearning Posted May 27, 2010 Author Share Posted May 27, 2010 Hi Ken, I want it to select ALL records between them dates, where intradelete=1 Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064123 Share on other sites More sharing options...
liamloveslearning Posted May 27, 2010 Author Share Posted May 27, 2010 Nevermind sorry its clicked! thanks ken, excuse my stupidity! Link to comment https://forums.phpfreaks.com/topic/203083-not-filtering-results/#findComment-1064127 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.