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
Post a Comment