I think the solution to my problem will be easier than me trying to explain it! But here goes. Also, I have no knowledge of programming which is why I love Alpha 5.
I am developing a property rental database.
Reccuring_table has information about the rental, i.e. tenant_id, period (calendar monthly etc), rent_amount (amount of the rent) and due_date.
When a new tenant is created, the above fields are appended to reccuring_table.
I then have another table, rentals_due. This table will contain all the rental due dates for the tenant. When a new tenant is created, the first rental is appended to start from the start date.
I then create an append operation from reccuring_table to rentals_due that does the following:
This works well and I thought I could run the operation every time the database is open for example.
However, there is a problem:
Firstly, if I didn't open the database for three months say (which is unlikely), it would only add one month to the rentals_due, so two months would not show (unless I opened the database another two times!)
Secondly, If I want to add a tenant who is already in a property and has been for say 2 years, I would add the tenant, but then I would have to run the append operation 24 times to bring it up to date.
All I need is a way of repeating the append operation until records to append = 0, then it would stop. This too would fix the problem of not opening the database often as it would always bring the rentals_due table up to the current date.
Any help would be greatly appreciated (I am also interested if there is an easier way to do what I suggest)
Many thanks in advance
Adrian
I am developing a property rental database.
Reccuring_table has information about the rental, i.e. tenant_id, period (calendar monthly etc), rent_amount (amount of the rent) and due_date.
When a new tenant is created, the above fields are appended to reccuring_table.
I then have another table, rentals_due. This table will contain all the rental due dates for the tenant. When a new tenant is created, the first rental is appended to start from the start date.
I then create an append operation from reccuring_table to rentals_due that does the following:
- Only appends records where due_date + 1 month < today (so that future rents are not put in as they are not due yet)
- If rent is due, append the record from reccuring_table to rentals_due table.
- When appending, add 1 month to the date in recurring table
- Also when appending, add 1 month to the date in the rentals_due
This works well and I thought I could run the operation every time the database is open for example.
However, there is a problem:
Firstly, if I didn't open the database for three months say (which is unlikely), it would only add one month to the rentals_due, so two months would not show (unless I opened the database another two times!)
Secondly, If I want to add a tenant who is already in a property and has been for say 2 years, I would add the tenant, but then I would have to run the append operation 24 times to bring it up to date.
All I need is a way of repeating the append operation until records to append = 0, then it would stop. This too would fix the problem of not opening the database often as it would always bring the rentals_due table up to the current date.
Any help would be greatly appreciated (I am also interested if there is an easier way to do what I suggest)
Many thanks in advance
Adrian
Comment