Expand my Community achievements bar.

SOLVED

Calculating month difference in Query activity

Avatar

Level 4

Hi

There is a requirement to find the month difference and what all the values in the month difference should be subtracted from 10.
For example, if the month difference is 3, the result should 10-3.
The answer will be 7, so I'd have to query in query activity

FYI-There is an attribute called date, and it has a date datatype. I tried below approach  , and to continue, I need to subtract from 10.

VV97_0-1703684562757.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

Hi @vani97 ,

Use the below expression,

10-(MonthsDiff(GetDate(),@confirmdate ))

ParthaSarathy_0-1703686141074.png