jbrill Posted July 12, 2007 Share Posted July 12, 2007 I have two dates in a form " startdate" and enddate" when i display the results i would like to show all results between, and including the two dates. how do i do this... this is my current query: My Variables: $userid = $_GET['idr']; $fromdate = $_GET['fromdate']; $todate = $_GET['todate']; The query: $result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' ORDER BY time"); Quote Link to comment Share on other sites More sharing options...
jbrill Posted July 12, 2007 Author Share Posted July 12, 2007 anyone? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 12, 2007 Share Posted July 12, 2007 my mysql querying isnt the greatest but try this: $result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' AND date BETWEEN {$fromdate} AND {$todate} ORDER BY time"); but your date formats have to be the same, i think. hope that helps. Quote Link to comment 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.