Hi,
I am trying to select all the records in a database table from a given date to 30 days before.
I have this:
"SELECT * FROM records WHERE DATE_SUB('2004-03-15', interval 30 day) AND id=1 ORDER BY date ASC";
For some reason this ignores the date claculation and returns all records in the table for that id.
Can anyone tell me where I am going wrong?
Thanks.
I am trying to select all the records in a database table from a given date to 30 days before.
I have this:
"SELECT * FROM records WHERE DATE_SUB('2004-03-15', interval 30 day) AND id=1 ORDER BY date ASC";
For some reason this ignores the date claculation and returns all records in the table for that id.
Can anyone tell me where I am going wrong?
Thanks.