community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Date range filter

Asteroid

Hi Guys,

 

I need to run a report based on 1 sql query that splits into two excel tabs. One tab for all time, next for prior 7 days, I wish to automate this using a date filter. I'm currently using a custom filter with  datetimediff(datetimetoday(),[Publish_Date],"days") <= 7 but for some reason it's not giving me the right numbers. Could someone advise where I'm going wrong, or perhaps suggest a better approach?

 

Thanks,

Alex

 

 

Highlighted
Bolide

@alex_reevoo,

 

I would recommend using the formula:

 

[Publish_Date] >= DateTimeAdd(DateTimeToday(),-7,'Days')

 

Goodluck,

MSalvage

 

EDIT: Might need to be -6 days depending on the exact time frame you are looking for.

Meteoroid

So what's the difference between the 2? I run into exactly the same issue....

Labels