Get data from last month | Community
Skip to main content
New Participant
Feb 2, 2022 4:21 PM UTC
Solved

Get data from last month

I am looking to run a query each month to pull data the month prior e.g if I were to run in Feb, it would pull Jan's data
The '1 months ago' option is not useful as this will not be run at the beginning of the month

Is there a way to pull just the prior month in whole?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
Feb 3, 2022 3:59 AM UTC

Hi @nialc ,

 

There are number of ways through which you can achieve this:

1) Schedule your workflow to run on 1st of every month and then use a month ago in the query.

2) In Query activity, do

Month(@contactDate) = Month(GetDate) -1 and

Year(@contactDate)=Year(GetDate)

 

Thanks,

Jyoti

1 reply

Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
Feb 3, 2022 3:59 AM UTC

Hi @nialc ,

 

There are number of ways through which you can achieve this:

1) Schedule your workflow to run on 1st of every month and then use a month ago in the query.

2) In Query activity, do

Month(@contactDate) = Month(GetDate) -1 and

Year(@contactDate)=Year(GetDate)

 

Thanks,

Jyoti

Translate