M
Marcus
Activity: house rentals; a contract is agreed with tenants that (should) pay
on a monthly basis; for history/tracking purposes, monthly due fees are
stored in a table that represents "periods" (terms\cycles); each contract
can have multiple periods, and each period holds begin\end date and due
fees; once a fee increase occurs, a new period is created holding new due
fees. Payments made are stored in another table.
Example:
Building A
Apartment 1
Contract M
Period 1 - begin, end, monthly due fee X
Period 2 - begin, end, monthly due fee Y
.........
Contract N
Period 1 - begin, end, monthly due fee XX
Period 2 - begin, end, monthly due fee YY
.........
Apartment 2
..........
The database holds data about buildings, apartments (many per building),
contracts (many per apartment), periods (many per contract), monthly
payments (many per period)
Given the following structure (I'm leaving out fields not envolved in the
discussion):
TABLE_BUILDINGS
id_building
description_building
TABLE_APARTMENTS
id_apartment
id_building
description_apartment
TABLE_CONTRACTS
id_contract
id_apartment
TABLE_PERIOD
id_period
id_contract
monthly_due_fee
TABLE_PAYMENTS
id_payment
id_period
date
monthly_amount_payed
Would like to obtain a spreadsheet like table for charting purposes; if
possible show data with a stacked line pivotchart (otherwise export data to
excel), to show "monthly_due_fee" trends; stacked line chart needeed to
higlight each apartment/fee trend.
View/Query layout.
The first row holds date descriptions (in a year/month fashion):
[empty] date1(year/month) date2(year/month) ........
dateX(year/month)
Following rows hold: building/apartment description and monthly payments:
Building A - Apartment 1 fee_date1 fee_date2 .....
fee_dateX
Building B - Apartment 2 fee_date1 fee_date2 .....
fee_dateX
.......
Building Z - Apartment zz fee_date1 fee_date2 .....
fee_dateX
No data about contracts and period is shown, just apartaments and fees.
I'm wondering if I can obtain such a result with a query (I'm accessing a
SQL server) or do I need to VBscript?
Thanks for helping
on a monthly basis; for history/tracking purposes, monthly due fees are
stored in a table that represents "periods" (terms\cycles); each contract
can have multiple periods, and each period holds begin\end date and due
fees; once a fee increase occurs, a new period is created holding new due
fees. Payments made are stored in another table.
Example:
Building A
Apartment 1
Contract M
Period 1 - begin, end, monthly due fee X
Period 2 - begin, end, monthly due fee Y
.........
Contract N
Period 1 - begin, end, monthly due fee XX
Period 2 - begin, end, monthly due fee YY
.........
Apartment 2
..........
The database holds data about buildings, apartments (many per building),
contracts (many per apartment), periods (many per contract), monthly
payments (many per period)
Given the following structure (I'm leaving out fields not envolved in the
discussion):
TABLE_BUILDINGS
id_building
description_building
TABLE_APARTMENTS
id_apartment
id_building
description_apartment
TABLE_CONTRACTS
id_contract
id_apartment
TABLE_PERIOD
id_period
id_contract
monthly_due_fee
TABLE_PAYMENTS
id_payment
id_period
date
monthly_amount_payed
Would like to obtain a spreadsheet like table for charting purposes; if
possible show data with a stacked line pivotchart (otherwise export data to
excel), to show "monthly_due_fee" trends; stacked line chart needeed to
higlight each apartment/fee trend.
View/Query layout.
The first row holds date descriptions (in a year/month fashion):
[empty] date1(year/month) date2(year/month) ........
dateX(year/month)
Following rows hold: building/apartment description and monthly payments:
Building A - Apartment 1 fee_date1 fee_date2 .....
fee_dateX
Building B - Apartment 2 fee_date1 fee_date2 .....
fee_dateX
.......
Building Z - Apartment zz fee_date1 fee_date2 .....
fee_dateX
No data about contracts and period is shown, just apartaments and fees.
I'm wondering if I can obtain such a result with a query (I'm accessing a
SQL server) or do I need to VBscript?
Thanks for helping