xorinzor
xorinzor

Reputation: 6467

Select query for 7 Complete Days ago records using MySQL

How can I get the records from 7 complete days ago?

using Interval 7 days at a time of 1 PM.

For example Select until 7 days ago at 1pm, whereas I need it to be 7 days ago from the start of that day (00:00).

Is there any way within the SQL query to achieve these records or would it require some custom PHP code ?

Upvotes: 1

Views: 64

Answers (1)

Seb
Seb

Reputation: 1551

Use

SELECT DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)

Upvotes: 2

Related Questions