Expand my Community achievements bar.

# Adobe Campaign Classic v7 & Campaign v8

SOLVED

## QUERY: Find the first day of the current month and then add two months

Level 1

QUERY: Find the first day of the current month and then add two months

Example:  Today: 11/22/2022   First Day of Month: 11/01/2022  Plus two months: 01/01/2023

My process has: checkDate before toDate(ToInteger(day of ToDate(current date) - 1) days before) + 2 month(s) in query window but does not work.

How do you write this query?

Thanks.

1 Accepted Solution

Level 2

Hello,

To identify first day of the month, you can use the Function YearAndMonth(<Date>). After that you just have to add two months. So you'll have something like this:

I hope this helps you.

Best.

2 Replies

Level 2

Hello,

To identify first day of the month, you can use the Function YearAndMonth(<Date>). After that you just have to add two months. So you'll have something like this:

I hope this helps you.

Best.

`Day(DateOnly(GetDate())) - (Day(DateOnly(GetDate())) - 1 )+'/'+ Iif((Month(DateOnly(GetDate())) + 2) > 12, (Month(DateOnly(GetDate())) + 2) - 12 , (Month(DateOnly(GetDate())) + 2)) + '/' + Iif((Month(DateOnly(GetDate())) + 2) > 12, Year(DateOnly(GetDate())) +1 , Year(DateOnly(GetDate())))`