I am a newbie in programming and trying to add some automation in my team to help with daily operation.
I try to create a function to create interest payment schedu
You can use the MSysObjects table and a Cartesian query to create this:
PARAMETERS
Period Text ( 255 ),
Periods Short,
FirstDate DateTime;
SELECT DISTINCT
10*Abs([Deca].[id] Mod 10)+Abs([Uno].[id] Mod 10)+1 As Sequence,
DateAdd([Period],[Sequence]-1,[FirstDate]) AS [DateStart],
DateAdd([Period],[Sequence],[FirstDate]) AS [DateEnd]
FROM
MSysObjects AS Uno,
MSysObjects AS Deca
WHERE
10*Abs([Deca].[id] Mod 10)+Abs([Uno].[id] Mod 10)<[Periods]
Run this with the parameters:
Period: q
Periods: 4
FirstDate: 2017-04-14