Jump to content

[SOLVED] Retrieve record with date diff less than 40days


kevin7

Recommended Posts

SELECT * FROM buyer WHERE state='d' AND (curdate()-date>40) ORDER BY id DESC"

 

I'm making a query, so that it will return all the records less than 40days,

but, im not so familiar with MySQL, my query returned error message.

 

my table structure is

id, name, phone, email, description, state, date

 

my date format is (YYYY-MM-DD, eg 2007-12-15)

can anyone tell me what's wrong with my query?

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.