M
MentalMark
Guest
I'm trying to produce a simple billing system which combines data from 3 tables and produces as an output 1 invoice list per month. I have got it to work, though in a very convoluted way - i'm sure there must be a much neater way of doing this. The 3 tables are:
Table 1
Customer ref (primary key)
Bill from date (e.g. 01/01/05)
Regular monthly bill date (e.g. 01)
Cease date (e.g. 30/11/05)
Table 2
Customer ref
Tariff from date (e.g. 01/01/05)
Tariff to date (e.g. 31/03/05)
Tariff code (e.g. T1)
[a customer may change tariffs during their lifespan, so there could be multiple entries for each customer ref in this table]
Table 3
Tariff code (primary key)
Tariff description
Price
As I said, I have achieved my goal by creating a huge master query which combines tables 1 and 2 to create fields for April 2005 invoice date, April 2005 tariff, May 2005 invoice date, etc, etc ... and then seperate queries for each month bringing in table 3 to create an invoice list for April 2005, May 2005, etc with customer ref, invoice date, tariff code and price
Any suggestions on a neater solution would be much appreciated, hope the above makes sense
Thanks,
Mark
Table 1
Customer ref (primary key)
Bill from date (e.g. 01/01/05)
Regular monthly bill date (e.g. 01)
Cease date (e.g. 30/11/05)
Table 2
Customer ref
Tariff from date (e.g. 01/01/05)
Tariff to date (e.g. 31/03/05)
Tariff code (e.g. T1)
[a customer may change tariffs during their lifespan, so there could be multiple entries for each customer ref in this table]
Table 3
Tariff code (primary key)
Tariff description
Price
As I said, I have achieved my goal by creating a huge master query which combines tables 1 and 2 to create fields for April 2005 invoice date, April 2005 tariff, May 2005 invoice date, etc, etc ... and then seperate queries for each month bringing in table 3 to create an invoice list for April 2005, May 2005, etc with customer ref, invoice date, tariff code and price
Any suggestions on a neater solution would be much appreciated, hope the above makes sense
Thanks,
Mark