sudhakararaog
10-30-2007, 09:45 PM
I have a table in mysql which i have defined as date and the values that are inserted have the following format for example : 2007-10-30 08:02:40
My requirement is to run a select query to retrieve a particular column on a specific date ex= "SELECT columnname from tablename where columnname='$dt'";
$sd=mysql_query($selectdate);
$sdr=mysql_num_rows($sd);
if($sdr > 0)
{ echo "Records found"
}
else {
echo "No Records found";
}
This works fine only if i manually change the format of the date field to the following format = 2007-10-30
I have more than 2000 records in the table so its not a good idea to edit the dates.
MY QUESTION IS = without editing the value of the date and the value of the date field being 2007-10-30 08:02:40, how can i use a select query which would ignore 08:02:40 and consider 2007-10-30 ONLY.
I need to implement this at the earliest. Any help in this regard will be greatly appreciated.
Thanks.
My requirement is to run a select query to retrieve a particular column on a specific date ex= "SELECT columnname from tablename where columnname='$dt'";
$sd=mysql_query($selectdate);
$sdr=mysql_num_rows($sd);
if($sdr > 0)
{ echo "Records found"
}
else {
echo "No Records found";
}
This works fine only if i manually change the format of the date field to the following format = 2007-10-30
I have more than 2000 records in the table so its not a good idea to edit the dates.
MY QUESTION IS = without editing the value of the date and the value of the date field being 2007-10-30 08:02:40, how can i use a select query which would ignore 08:02:40 and consider 2007-10-30 ONLY.
I need to implement this at the earliest. Any help in this regard will be greatly appreciated.
Thanks.