Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Datetime - 1 fails on First day of the month

mkav9893
8 - Asteroid

Hi,

 

I am having an issue for several scheduled workflows that I am running. I append the date on the end of the filename, and I exclude the previous days file by specifying on the date, using ToNumber([DateTimeNow])-1. However, this fails on the first day of the month because it sees 20180800 rather than 20180731 (As seen in the attached screenshot). Is there a way to handle this to dynamically opt to the last day of the month?

 

 

1 REPLY 1
patrick_digan
17 - Castor
17 - Castor

@mkav9893 how about:

 

ToNumber(DateTimeAdd([DateTimeNow],-1,"days"))

EDIT strike that. what about:

DateTimeFormat(DateTimeAdd(DateTimeNow(),-1,"days"),"%Y%m%d")

 

Labels