Get data from last month | Community
Skip to main content
February 2, 2022
Solved

Get data from last month

  • February 2, 2022
  • 1 reply
  • 793 views

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.
Best answer by Jyoti_Yadav

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
February 3, 2022

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