Expand my Community achievements bar.

SOLVED

Get data from last month

Avatar

Level 1

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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