AboYousef16
AboYousef16

Reputation: 85

How can i make condition when date in db less than date now 7 days in event mysql?

I want make Event in my mysql but the problem is in where condition , I want make update my column if date today is greater than date in databse more or equal 7 days... this is how the date looks like in mysql 2017-03-02 11:22:43

update mytable
set status=0
where date(insert_at) < date('-7 day')

Any help i will be gratfull

Upvotes: 0

Views: 20

Answers (1)

Lexx918
Lexx918

Reputation: 222

where insert_at < NOW() - INTERVAL 7 DAY

Upvotes: 1

Related Questions