I'm trying to get a date range and a transaction type in a query. I'm working in PHP with a Mysql database. Originally, the statement was
("select * from accounting WHERE date between '$startdate' AND
'$enddate'",$prop);
It works beautifully, no issues @ all. But I also need it to select a column in the database called transaction type. Here's how I modified it:
("SELECT date, account, description, Income FROM accounting where
transactiontype = 'Income' and WHERE date between '$startdate' AND
'$enddate' order by date ASC",$prop);
I'm getting the error message: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE date between '2012/09/01' AND '2013/04/17' order by date ASC' at line 1 Query: SELECT date, account, description, Income FROM accounting where transactiontype = 'Income' and WHERE date between '2012/09/01' AND '2013/04/17' order by date ASC Any Help would be greatly appreciated.