MySQL PHP help - SUM(total)
Hi,
I am creating a report generator for my client. They have a form where people can order some samples. The samples ordered goes into a database. (The sample name and date gets inserted into the database )
The report I have created allows my client to search between dates to check how many samples have been ordered within two dates.
I think they mostly check it monthly....
The first month worked fine. When the client searched between two dates the correct amount of samples ordered appeared. However now that we're in the 2nd month - when I search between two dates the number is a lot higher. When I search how many samples have been ordered on one day the number is correct - but is wrong if I search from yesterday to today....
I'm not sure why this is happening. This is my SQL query
("SELECT samplename, date, SUM(total) FROM tbl_samplesordered WHERE date BETWEEN '$fromdate' AND '$todate' GROUP BY samplename");
The date format is dd/mm/yy
Any ideas what could be going wrong?
