Link to home
Start Free TrialLog in
Avatar of Charlene Kerr
Charlene Kerr

asked on

Problem with a VS expression on a report

Trying to fix a broken expression in Visual Studio - using the Now() function, we need to get last month. Been using = "For the Month of" + MonthName(Now()-1), or at least that appears to be it. But this month it error'd, and can't seem to tweak the expression. For a report run today it should read "For the Month of December"
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

I would use variables and an if statement
i..e this pseudocode
if (Month(Now()) == "January" then Month = "December"
Else Month = (MonthName(Now()-1))
End If
" For the Month of " + Month
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.