Hello,
I've got the following field in a table.
Date_LastStatement |
---|
30/11/2018 |
30/11/2018 |
31/12/2018 |
31/12/2018 |
31/12/2018 |
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.
What's wrong?
Thanks in advance.
Try:
Date ( Month ( $$StatementDate ) ; 0 ; Year ( $$StatementDate )
In short, the 0 as the day goes back a month, by definition, so you don't need to subtract one from the month.