Skip to content
Advertisement

How to get last 3 days records from database without today?

I am using this code:

JavaScript

And result will be like this:

JavaScript

But I want this:

JavaScript

Advertisement

Answer

Use a range here:

JavaScript

Assuming today’s date be 2022-05-12, the above logic would exclude this date but include the three previous days, from 11th May to 9th May.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement