Date minus a few weeks

Reply
Visitor

Date minus a few weeks

Hello guys, 

 

Am looking for code which states:

Return X (actuals) between (current date minus 3 weeks) and (current date minus 2 weeks).

The code I am currently writing is not returning the correct values for the correct dates.

 

Could someone help me out please?

 

Many thanks to the community,

 


Accepted Solutions
Black Belt

Re: Date minus a few weeks

Here's the basics on how I would write this as a beast mode:

CASE WHEN `Date` >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 WEEK) AND `Date` <= DATE_SUB(CURRENT_DATE(), INTERVAL 2 WEEK)
THEN `Actuals`
END

Hope that helps,

Valiant

 

**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.


All Replies
Black Belt

Re: Date minus a few weeks

Here's the basics on how I would write this as a beast mode:

CASE WHEN `Date` >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 WEEK) AND `Date` <= DATE_SUB(CURRENT_DATE(), INTERVAL 2 WEEK)
THEN `Actuals`
END

Hope that helps,

Valiant

 

**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.

Announcements
Win free lodging at Domopalooza! We want to hear your Domo story, enter our Dojo contest and win up to four nights lodging at Domopalooza. Click here!