Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All
How i can get Previous month from Current date as i need to generate QVD and use Month and Year as their filed using system date.
Thanks
Kushal Thakral
Previous month
Month(AddMonths(Today(),-1))
Previous Year
Year(AddMonths(Today(),-1))
Current Month
Month(Today())
Current Year
Year(Today())
Month(Today())-1 as PreviousMonth
Update : The above will give you month number.
If you want month number, use below
in script
=Subfield('$(MonthNames)',';',Month(Today())-1) as PreviousMonth
in UI
=Subfield('$(MonthNames)',';',Month(Today())-1)
Month(AddMonths(Today(),-1))
Write like
Month(Max(DateField))-1 as PreviousMonth
What is mean for QVD generate and used Month Year
Manish,
If Month is January, Month(Today())-1 is zero and you will get nothing from this expression
Subfield('$(MonthNames)',';',Month(Date#('01/01/2014','D/M/YYYY'))-1)
IF(Month(Date(YourDateField))-1=0,12,Month(Date(YourDateField))-1)
or
=Subfield('$(MonthNames)',';',IF(Month(Date(YourDateField))-1=0,12,Month(Date(YourDateField))-1))
Dear All
I dont have Date field so need to calculate Month and Year using system date
So can you help with the same.
Thanks
Kushal
IF(Month(Today())-1=0,12,Month(Today())-1)
or
=Subfield('$(MonthNames)',';',IF(Month(Today())-1=0,12,Month(Today())-1))
Previous month
Month(AddMonths(Today(),-1))
Previous Year
Year(AddMonths(Today(),-1))
Current Month
Month(Today())
Current Year
Year(Today())
Hi Kushal,
You try the following Syntax-:
=SUM({<MONTH={">=$(=MIN(MONTH)-1)<=$(=MAX(MONTH)-1)"}>}FIELDNAME)
it definitely work.