Vallegirl Posted August 4, 2009 Share Posted August 4, 2009 Good afternoon everyone, I am basically new to mysql, but is trying as best as I can to learn it, here is the problem I am having. I have a database that stores records from multiple users on different dates, I need to be able to select all the records in a date range, however, I want this to include the starting date and the ending date. This is what I have which is not returning the end date. SELECT * FROM custable WHERE updated >= '".$_POST["fr_date"]."' AND updated <= '".$_POST["to_date"]; I am using Mysql version 5.0 Please not that I use BETWEEN also which returns the same thing. Please note also that the form is collecting the input from calendar. Can someone be so kind as to assist me please. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/168858-date-range-statement/ Share on other sites More sharing options...
Maq Posted August 4, 2009 Share Posted August 4, 2009 What type is your 'updated' field and what format are your POSTs in? (Note: It's conventional to use single quotes in associative arrays.) This is what I have which is not returning the end date. Could you elaborate on this comment? Does it return anything? Quote Link to comment https://forums.phpfreaks.com/topic/168858-date-range-statement/#findComment-890945 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.