Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression help

Hi All,

Need help on expression:

I have a date calendar, I want to show Selected Month and Year in two text boxes. Conditions are as below:

  1. If there is no selection of Year, Month, Day (Default to Current year, Current month in the test boxes)
  2. If Year only selected and that is Lessthan current year, show DEC month & Selected Year in boxes.

          e.g. 2013 selected, show DEC & 2013

    3. If Year only selected and that is Current year default to Current month & current year in boxes.

            e.g. 2014 selected, show Sept & 2014

    4. If Year, Month selected – show as selected in boxes.

    5. If Day only selected, show the current month and current year in boxes.

    6. If month only selected, show current year and current month.

Can anybody help?

Thanks,

Lakshmi.

13 Replies
MayilVahanan

Hi

Try like this

= 'Month: ' & if(GetSelectedCount(Day) <> 0 and getselectedcount(Month) = 0 and getselectedCount(Year) = 0, Month(Today()), if(Max(Year) = Year(Today()) and getselectedcount(Month)=0, Month(Today()), Max(Month)) )

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
MK_QSL
MVP
MVP

=IF(GetSelectedCount([Invoice Date]) > 0 ,Month([Invoice Date]),

  IF(GetSelectedCount(Year) = 0 and GetSelectedCount(Month) = 0, Month(Today()),

  IF(GetSelectedCount(Year) > 0 and GetSelectedCount(Year) = Year(Today()), Month(Today()),

  IF(GetSelectedCount(Year) > 0 and GetSelectedCount(Year) < Year(Today()), SubField('$(MonthNames)',';',Max(Month))))))

Not applicable
Author

Hi Manish,

Thanks a million, it is working. Can I move these 2 values in to 2 variables? basically I needs get count of a field based on the 2 variables.

Thanks,

Lakshmi.

MK_QSL
MVP
MVP

You can... Kindly close this thread by selecting appropriate answer