If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#13356 by NBDAB
Mon Oct 12, 2009 5:26 pm
Thanks in advance - We have two questions?

Q1) We would like to calculate a Contracts end date based on a fixed duration of (6,12 or 24) months

We have three three attribues. StartDate, EndDate (Both are MM/DD/YYYY, however EndDate is Calculated) and Contract_Duration (Number,6,12,24)

Q2) Months_Differece

based on the same attributes we wish to Calculate the Months Difference between the Start and End to use for other calculations

Thank you

#13359 by tford
Mon Oct 12, 2009 6:53 pm
Look through the functions -- specifically MONTH_ADD

#13360 by tford
Mon Oct 12, 2009 6:55 pm
and these 2 functions: MONTH_DIFFERENCE MONTH_DIFFERENCE2
#13361 by NBDAB
Mon Oct 12, 2009 7:00 pm
Thanks will try nue
Regards, Lars
#13363 by NBDAB
Mon Oct 12, 2009 7:29 pm
hej, we tried this

RULE:

Customer.ContractEndDate=MONTH_ADD(Customer.ContractStartDate+Customer.ContractDurationMonths)

With ERROR:

com.bas.shared.ruleparser.ParseException Unsupported function MONTH_ADD

The EndDate attribute is Calc, and same format as StartDate
The ContractDurationMonths is just a Number attribute with four choices 6,12,24,36

Hrm.... any ideas?

#13364 by NBDAB
Mon Oct 12, 2009 7:31 pm
also, Version 4.7 Build (1246), mysql

#13365 by tford
Mon Oct 12, 2009 7:33 pm
No + needed. Please look at the syntax in user guide.
#13366 by NBDAB
Mon Oct 12, 2009 7:41 pm
after a kafe break we found error

Customer.ContractEndDate=MONTH_ADD(Customer.ContractStartDate,Customer.ContractDurationMonths)

PLUS

The Attribute formating for the dates changed to

dd MMMM yyyy

Thanks, Lars
#54261 by yahya
Fri Jul 03, 2020 6:17 am
If I want to create a new contract that starts from the beginning of a new financial year, I try apply the below:

Customer.ContractStartDate=MONTH_ADD(MONTH(Customer.FinancialYearEndDate)+FIRST_DAY_OF_NEXT_MONTH)

I get an error to say that 'FIRST_DAY_OF_NEXT_MONTH' does not exist, whether it is a business object rule or in a process action.
#54262 by eagles9999
Fri Jul 03, 2020 9:45 am
yahya wrote:If I want to create a new contract that starts from the beginning of a new financial year, I try apply the below:

Customer.ContractStartDate=MONTH_ADD(MONTH(Customer.FinancialYearEndDate)+FIRST_DAY_OF_NEXT_MONTH)

I get an error to say that 'FIRST_DAY_OF_NEXT_MONTH' does not exist, whether it is a business object rule or in a process action.


Would this not work?

Customer.ContractStartDate=DATE_ADD(Customer.FinancialYearEndDate,1)

If FinancialYearEndDate = June 30 2020
The ContractStartDate = July 1 2020
#54263 by PointsWell
Fri Jul 03, 2020 10:31 am
yahya wrote:If I want to create a new contract that starts from the beginning of a new financial year, I try apply the below:

Customer.ContractStartDate=MONTH_ADD(MONTH(Customer.FinancialYearEndDate)+FIRST_DAY_OF_NEXT_MONTH)

I get an error to say that 'FIRST_DAY_OF_NEXT_MONTH' does not exist, whether it is a business object rule or in a process action.


FIRST_DAY_OF_NEXT_MONTH requires parameters.

From manual IF FIRST_DAY_OF_PREV_MONTH (Account.OpeningDate=01/09/2004) Then ...
#54270 by yahya
Sat Jul 04, 2020 7:55 am
eagles9999 wrote:Would this not work?

Customer.ContractStartDate=DATE_ADD(Customer.FinancialYearEndDate,1)

If FinancialYearEndDate = June 30 2020
The ContractStartDate = July 1 2020


Thanks Mark,
That would work, my next dilemma is how do I continue when 2020 is over and we in 2021, I could possibly run a scheduled process that updates the FinancialYearEndDate.
#54271 by eagles9999
Sat Jul 04, 2020 8:59 am
Hi Yahya,

Please PM me or send me an email to [email protected] or [email protected].
Would need to understand a bit more context of what you are wanting to do.

Who is online

Users browsing this forum: No registered users and 42 guests