Month ( Get ( CurrentDate ) ) = Month ( Portaltable::DateFIeld )
would filter by month. Use your names in place of mine for the portal's table occurrence and your date field. But you may want to filter by year as well or you might see January 2012 and January 2013 records in your portal during this month.
Thanks that works..... Month (Get (CurrentDate)) -1 = Month (Table::Date) would yield last month? I can't seem to get this working properly
Month (Get (CurrentDate)) -1 produces 0 instead of 12 for dates in January.
You can build in an If function that returns 12 when the month is January:
Let ( m = Month ( Get ( CurrentDate ) ) ; m = 1 ; 12 ; m - 1 )
You'll need a similar calculation to return year - 1 for the month of January as well.
Or you might use this approach:
Define a calculation field in your portal table, cMonth as DateField - Day ( Datefield ) + 1 and select Date as the return type. This returns the date for the first day of the month for all dates in date field in the same month.
Then you can use:
Date ( Month ( get ( currentDate ) ) - 1 ; 1 ; Year ( Get (currentDate ) ) ) = PortalTable::cMonth
This matches by month and date and the Date function automatically adjusts the date to be December of the previous year when the current date falls in January.