Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
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.
=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))))))
=IF(GetSelectedCount([Invoice Date]) > 0 ,Month([Invoice Date]) & ' ' & Year([Invoice Date]),
IF(GetFieldSelections(Year)<Year(Today()),SubField('$(MonthNames)',';',Max(Month)) & ' ' & Year, Month(Today()) & ' ' & Year(Today())))
Chagne [Invoice Date] to your DateFieldName
HI
Try like this
1. = 'Year: ' & if(GetSelectedCount(Day) <> 0 and getselectedcount(Year) = 0, Year(Today()), if(GetSelectedCount(Year) = 0, Year(Today()), Max(Year)) )
2. = 'Month: ' & if(GetSelectedCount(Day) <> 0 and getselectedcount(Month) = 0, Month(Today()), if(Max(Year) = Year(Today()), Month(Today()), Max(Month)) )
Hi Mayil,
When i choose month showing wrong. when i select 2014, april - showing 2014 - Sept.
Other years are OK.
Sorry, I realised that you want two different text box ... use this...
=IF(GetSelectedCount([Invoice Date]) > 0 ,Month([Invoice Date]),
IF(GetFieldSelections(Year)<Year(Today()),SubField('$(MonthNames)',';',Max(Month)), Month(Today())))
=IF(GetSelectedCount([Invoice Date]) > 0 ,Year([Invoice Date]),
IF(GetFieldSelections(Year)<Year(Today()),Year,Year(Today())))
Hi
Above combination u didn't mention ..
For that, month will display "Dec" ? If so,
Try like this
= 'Month: ' & if(GetSelectedCount(Day) <> 0 and getselectedcount(Month) = 0 and getselectedCount(Year) = 0, Month(Today()), if(Max(Year) = Year(Today()), Month(Today()), Max(Month)) )
Hi Manish & Mayil,
Thanks for help. both conditions are working except if i choose 2014 & Month. all time taking Sept - 2014.
=IF(GetSelectedCount([Invoice Date]) > 0 ,Month([Invoice Date]),
IF(GetFieldSelections(Month) <> 0,
IF(GetFieldSelections(Year)<Year(Today()),SubField('$(MonthNames)',';',Max(Month)), Month),
Month(Today())))
and
=IF(GetSelectedCount([Invoice Date]) > 0 ,Year([Invoice Date]),
IF(GetFieldSelections(Year)<Year(Today()),Year,Year(Today())))
Hi Manish & Mayil,
Thanks for help. both conditions are working except if i choose 2014 & Month. all time taking Sept - 2014.
Hi Manish,
If i dont choose anything month is blank, else everything working.