Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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