ShootingBlanks Posted November 16, 2007 Share Posted November 16, 2007 Hello. I have two fields that users can enter dates into, and then I want to pull records that fall only between those two dates (based on the "due_date" column in my table). I have the fields properly formatted for SQL date format, but is this code for the "WHERE" part of my SQL expression valid? (and if not, what should it be): "WHERE projects.due_date > '".$_GET['date1']."' AND projects.due_date <= '"..$_GET['date2']."'" Thanks!... Quote Link to comment https://forums.phpfreaks.com/topic/77631-solved-newbie-question-where-statements/ Share on other sites More sharing options...
pocobueno1388 Posted November 16, 2007 Share Posted November 16, 2007 Try this WHERE projects.due_date BETWEEN {$_GET['date1']} AND {$_GET['date2']} Quote Link to comment https://forums.phpfreaks.com/topic/77631-solved-newbie-question-where-statements/#findComment-392986 Share on other sites More sharing options...
ShootingBlanks Posted November 16, 2007 Author Share Posted November 16, 2007 That worked great - thanks!... Quote Link to comment https://forums.phpfreaks.com/topic/77631-solved-newbie-question-where-statements/#findComment-393045 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.