This is the scenario:
cmp_table
id description thecalldate
1 Pit Bull 2004-04-25 02:03:20
2 Stray Dog 2004-04-25 20:21:32
etc..
etc....
$query = "select year(thecalldate) as 'year',DAYOFMONTH(thecalldate) as 'monthday',DAYNAME(thecalldate) as 'weekname', MONTHNAME(thecalldate) as 'monthname', count(*) as 'no' from cmp_table where month(thecalldate) = '$draw_m' and year(thecalldate) = '$draw_y' group by dayofmonth(thecalldate) order by thecalldate";
while($myrow=mysql_fetch_array($lookresult)){
$no=$myrow["no"];
$callyear=$myrow["year"];
$callmonth=$myrow["monthname"];
$dayname=$myrow["weekname"];
$monthday=$myrow["monthday"];
echo "$callmonth $monthday, $callyear - $dayname ------ $no";
}
this in return would produce...
April 25, 2004 - Thursday ------ 2
Now my boss tells me that we need to add all the dogs.. i mean disabled dogs! and keep it in diff column when reporting...
my boss provided me with this table (with data)...
inc_table
id description datetime
1 1 Eyed Pit Bull 2004-04-25 02:03:20
2 3 Legged Stray Dog 2004-04-25 20:21:32
i have 2 tables (cmp_table and inc_table)
my question now is... how can i create a qry that would result an output like this:
DATE complete dog incomplete dog
April 25, 2004 - Thursday 2 4
I need advice on this.. or my head is going to land on a slinger!
cmp_table
id description thecalldate
1 Pit Bull 2004-04-25 02:03:20
2 Stray Dog 2004-04-25 20:21:32
etc..
etc....
$query = "select year(thecalldate) as 'year',DAYOFMONTH(thecalldate) as 'monthday',DAYNAME(thecalldate) as 'weekname', MONTHNAME(thecalldate) as 'monthname', count(*) as 'no' from cmp_table where month(thecalldate) = '$draw_m' and year(thecalldate) = '$draw_y' group by dayofmonth(thecalldate) order by thecalldate";
while($myrow=mysql_fetch_array($lookresult)){
$no=$myrow["no"];
$callyear=$myrow["year"];
$callmonth=$myrow["monthname"];
$dayname=$myrow["weekname"];
$monthday=$myrow["monthday"];
echo "$callmonth $monthday, $callyear - $dayname ------ $no";
}
this in return would produce...
April 25, 2004 - Thursday ------ 2
Now my boss tells me that we need to add all the dogs.. i mean disabled dogs! and keep it in diff column when reporting...
my boss provided me with this table (with data)...
inc_table
id description datetime
1 1 Eyed Pit Bull 2004-04-25 02:03:20
2 3 Legged Stray Dog 2004-04-25 20:21:32
i have 2 tables (cmp_table and inc_table)
my question now is... how can i create a qry that would result an output like this:
DATE complete dog incomplete dog
April 25, 2004 - Thursday 2 4
I need advice on this.. or my head is going to land on a slinger!