Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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