Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a timestamp field in AM/PM format. I want month year format. So I used monthname(CREATIONDATE) as monthyear and I am getting the month -Years like "Apr 2023" .
BUt in If condition I must write if Monthyear>='Apr 2023',Monthyear. That is I want all monthyears on and after Apr 2023. BUt I am not getting.
If (monthyear='Apr 2023', MOnthyear) is working but '>=' is not .
If I use Date(Date#(left(CREATIONDATE,10),'DD/MM/YYYY'),'MMM YYYY'), I am getting repeated like nOv 2020,
Nov 2020 , Dec 2023 etc...
Any help is appreciated.
Thanks
Niranjana
try with Num()
Num(CREATIONDATE)>=num(Date#('Apr 2023','MMM YYYY'))
Regards,
Prashant Sangle
When using
monthname(CREATIONDATE) as Monthyear
the new field Monthyear becomes a dual, containing both the string value 'Apr 2023' and the numeric value equivalent to the date 2023-04-01. When comparing with Monthyear in the script or application you can utilise that like below.
If(Monthyear >= makedate(2023,4,1), ...
Or like @PrashantSangle 's example
If(Monthyear >= Date#('Apr 2023','MMM YYYY'), ...