2 Replies Latest reply on Mar 4, 2013 3:52 PM by ErikWegweiser

# Help with (Month(Status(CurrentDate)) - 1)

I'm trying to use the following formula:

(Month (DateField) = (Month(Status(CurrentDate)) - 1) and Year (DateField) = Year(Status(CurrentDate))) or (Month (DateField) = 12 and Year (DateField) = (Year(Status(CurrentDate)) - 1))

My Database date field is actually called [Date] which I've plugged into the formular which should give Last Month's Records

(Month (Date) = (Month(Status(CurrentDate)) - 1) and Year (Date) = Year(Status(CurrentDate))) or (Month (Date) = 12 and Year (Date) = (Year(Status(CurrentDate)) - 1))

When I save the forumlar I get "This function cannot be found" referring to STATUS i.e (Month(Status(CurrentDate))

I'm using FileMaker Po Advance 12.

• ###### 1. Re: Help with (Month(Status(CurrentDate)) - 1)

It may work better with Month( Get( CurrentDate) ) and Year( Get( CurrentDate ) )

P.S.  Your expression ( Month( Get( CurrentDate ) - 1 ) can return 0 in January which may cause you problems.

• ###### 2. Re: Help with (Month(Status(CurrentDate)) - 1)

Hi, ajayz:

There is no Status(CurrentDate) function, but rather a Get(CurrentDate) or better, Get(CurrentHostTimestamp).

You might try this modification of your formula:

Let([

dayt = YourDateField;

tuday = Get(CurrentHostTimestamp)

];

(

Month( dayt ) = ( Month( tuday ) - 1 )

and

Year ( dayt ) = Year( tuday )

)

or

(

Month( dayt ) = 12

and

Year( dayt ) = ( Year( tuday ) - 1)

)

)