In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Finding previous month of data using IN-Database functions

lasmithfla
6 - Meteoroid

How do I write something similar to this to use in database?

Trying to pull the previous month of data and automate it.

 

DateTimeFormat(DateTimeAdd(DateTimeToday(),-1,"month"),'%Y-%m') = DateTimeFormat([EventDate],'%Y-%m')

1 REPLY 1
apathetichell
20 - Arcturus

kind of depends upon the back end of the SQL but something like:

TRUNC(DATEADD(MONTH, -1, GETDATE()), "YY-DD") = TRUNC("EventDate", "YY-DD")

 

 

Labels
Top Solution Authors