Problem - Query with dates
Posted: Fri Mar 12, 2010 4:53 am
Hi
I need to do one query between 2 dates . I try :
But it doesn't work. For example it returns empty dates (0000/00/00). What's wrong?
For example: If datainicial=2010-03-12 I'll get dates
0000-00-00
2010-03-11
2010-02-28
2010-03-12
if data inicial=2010-03-11 the results are
0000-00-00
2010-03-11
2010-02-28
Why?
Thank you
I need to do one query between 2 dates . I try :
Code: Select all
$query="select * from negocios where Data_venda BETWEEN '$_POST[datanicial]' AND '$_POST[datafinal]'";
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)){
For example: If datainicial=2010-03-12 I'll get dates
0000-00-00
2010-03-11
2010-02-28
2010-03-12
if data inicial=2010-03-11 the results are
0000-00-00
2010-03-11
2010-02-28
Why?
Thank you