Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am wanting to create some dynamic text in a textbox. I am working on a financial dashboard, and one of the functions I am creating is to have a button that will calculate the currently selected month to the previous month. My listbox is populated with the month values
month(Date(MonthStart(TRAN_DT,0),'MM/DD/YYYY')) as MONTH_DATE
from the above created field. If the user selected March, I would like the button to say "Comparison of March to February of current year.
Any help is appreciated
Mike
Hi,
maybe one solution could be:
='Comparison of '&Date(Date#(MONTH_DATE,'MMM'),'MMMM')&' to '&Date(Date#(Mod(MONTH_DATE-2,12)+1,'M'),'MMMM')&' of current year.'
(You can skip the Mod() part as comparisons between Jan and Dec probably don't make much sense, it just didn't feel right to have no predecessor to Jan. Maybe it would be better to use a YearMonth field instead, e.g. using the MonthName() function?)
One note regarding your MONTH_DATE field:
You could just generate it like
Month(TRAN_DT) as MONTH_DATE
because neither the nested Date() nor MonthStart() function change the resulting Month() value of your expression.
hope this helps
regards
Marco