I have been building a publishing program for office summaries for the better part of the week. I written a program to calculate the first day of the week, and I want to return from the database everything that was reported during that week. I am doing this for each division, separately using a while loop, etc, so my select is a little complex:
Select * from tblsummary WHERE office = $cur_office AND set_date = date_add('$weekof', interval 6 day);
I have looked at several examples and even have an interval program working on other sites, however for the life of me I can't get this one to return the correct results. When I set it to = only I get nothing (when I know there is at least one for the week). If I set it to >= I get returns from next week and even futher out.
Can some one tell me what I am doing wrong? I've tackled much larger problems than this today and perhaps my brain is just fried. I looked at date_add on mysql.com, and I have read the manual I purchased on MySql, but I cannot see what I am doing wrong here. Any advice is greatly apprecaited.
Thank you,
Brian
Select * from tblsummary WHERE office = $cur_office AND set_date = date_add('$weekof', interval 6 day);
I have looked at several examples and even have an interval program working on other sites, however for the life of me I can't get this one to return the correct results. When I set it to = only I get nothing (when I know there is at least one for the week). If I set it to >= I get returns from next week and even futher out.
Can some one tell me what I am doing wrong? I've tackled much larger problems than this today and perhaps my brain is just fried. I looked at date_add on mysql.com, and I have read the manual I purchased on MySql, but I cannot see what I am doing wrong here. Any advice is greatly apprecaited.
Thank you,
Brian