I've got the following field in a table.
g_Date_Statement (global field) = 31/1/2019
I've written the following script to find all records in the last day of the last month based on the "g_Date_Statement"
Set variable [ $$StatementDate ; g_Date_Statement ]
Show all records
Enter find mode 
Set field [ Date_LastStatement ; Date ( Month ( $$StatementDate ) - 1 ; 0 ; Year ( $$StatementDate ) )
Perform find 
However, the result is a list of records dated 30/11/2018. What I need is those as of 31/12/2018.
Thanks in advance.