How do I get Timestamp minus 6 weeks in MySQL? -


i have field named timestamp. last time member logged in. looking include clause in query like

where timestamp > todays date - 6 weeks 

how this? trying include users have logged in in last 6 weeks.

thanks

i find syntax more readable date_sub, either way works.

where timestamp >= now() - interval 6 week 

if want go "today" (midnight) instead "now" (current time), use this

where timestamp >= date(now()) - interval 6 week 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -