how to insert the data one table to another Customer have a 6 month Contract period when create the customer 1000 with 6 months contract that record should be save on contract list with 6 months records like jan,feb,march like until 6 month can you give me reference code if you any links also
likes this
Contract1 01-01-2021 10000 ******
Contract1 02-01-2021 10000 ******
Contract1 02-06-2021 10000 ******
0
Answers
int ContractPeriod := given by user;
date ContractDate:= given by user or today;
currentMonth:=DATE2DMY(ContractDate,2);
currentYear:=DATE2DMY(ContractDate,3);
newDate:=DMY2DATE(1, currentMonth, currentYear); //first day of current month
FOR i:=1 to ContractPeriod DO BEGIN
newDate:=CALCDATE('<+1M>', newDate);
tableContractDates.INIT;
tableContractDates.Customer:=Customer; //given by user
tableContractDates.Contract:=Contract; //given by user
tableContractDates.Date:=newDate;
tableContractDates.INSERT(TRUE);
END;
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!