Jump to content

date range statement


Vallegirl

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/168858-date-range-statement/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/168858-date-range-statement/#findComment-890945
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.