savagenoob Posted January 8, 2009 Share Posted January 8, 2009 I want to search and display results that land between and ON the dates entered into the text fields. I only know how to do the BETWEEN query. How can I modify this to search on and between two dates. $query = "SELECT Amount1RS, SUM(BrokerFee), SUM(TotalCollected), SUM(Commission), AVG(BrokerFee), COUNT(ID) FROM accounting WHERE Date BETWEEN '$newdate1' AND '$newdate2' GROUP BY Amount1RS"; Quote Link to comment https://forums.phpfreaks.com/topic/139960-solved-search-between-dates/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 8, 2009 Share Posted January 8, 2009 Between IS inclusive of the min and max values used - If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1 Quote Link to comment https://forums.phpfreaks.com/topic/139960-solved-search-between-dates/#findComment-732285 Share on other sites More sharing options...
savagenoob Posted January 8, 2009 Author Share Posted January 8, 2009 hm... OK then Im just a Nub.... Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/139960-solved-search-between-dates/#findComment-732296 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.