Jump to content

DATE range problem


chipmunken

Recommended Posts

Ok I want to make a quarry that get's data from current date and X days back in time.

This is because I want to extract today's stats and compare them with previous days.

This is what I got so far.

 

SELECT *
FROM `sla_gen`
WHERE transaction_date BETWEEN CURDATE() AND DATE_SUB(CURDATE(), INTERVAL 5 DAY)

 

I have fiddled around with ADDDATE() and some other functions but I'm totally lost.

I don't even know if I'm on the right track here.

 

A pointer in the right direction is much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/191668-date-range-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.