Hi,
I think you need to add the dates to your where statement:
SELECT DATE_FORMAT(date_hours_worked, '%M %D %Y') as 'Work Date',
assinged_to_which_group as 'Member Company',
employee_name as 'Imployee Number',
hours_worked as 'Hours Worked',
payroll_accounting_group as 'Work Group'
FROM `<?php echo $TABLE_PREFIX ?>paysheet_hours`
<?php
$start = date("Y-m-d 00:00:00", strtotime('2013-02-10'));
$end = date("Y-m-d 00:00:00", strtotime('2013-02-28'));
$timedate = strtotime('date_hours_worked');
?>
<?php if ($timedate > $start OR $timedate < $end): ?>
WHERE assinged_to_which_group = 176 AND date_hours_worked > '<?php echo $start; ?>' AND date_hours_worked < '<?php echo $end; ?>'
GROUP BY date_hours_worked
ORDER BY YEAR(date_hours_worked) DESC, MONTH(date_hours_worked) DESC
<?php endif; ?>
The code will return all results between these two dates, so you might need to change it slightly if you want it to return items from just these two dates.
I'm not sure if date_hours_worked is the correct field to use in the where loop, so you might need to change that as well.
I've also used the date function to convert your strings into the correct date time format for MySQL.
Let me know if you have any questions.
Thanks!
Greg
Greg Thomas
PHP Programmer - interactivetools.com