Forum Moderators: open
i have a db table with rows i need to perform calcuations on.
im looking to sum up the totals for 2 columns based on some parameters
$sumtotals =mysql_query("SELECT SUM(est_hours), SUM(act_hours) FROM timeline WHERE week_no="$counter" AND week_com_date="SUBSTR($theyear)"");
the issue i think is this
week_com_date="SUBSTR($theyear)"
in my db i have a date field yyyy-mm-dd but all i need to check is that the year is correct - i need to look at the date field and if 2008 is present then select the row values est_hours and act_hours (if week number is correct as well of course)
im not sure how to do that- can anyone help out at all?