Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding records based on query results

Status
Not open for further replies.

DorenM

Programmer
Mar 4, 2002
5
US
Hello! Hope someone out here can get me going in the right direction. I'm trying to create journal entries based on the number of months between two dates, the beginning and end of a contract in the CONTRACTS table. I want to generate a record for each month a contract is active and post a dollar amount on each record in the Contracts_Detail table. Is this a VBA solution or an append query solution.

Thanks so much for your help! :)
D.
 
It is very simple if in the contract details table you have the field with Date (which is certainly within the period of contract validity).

You can use the group-by querry with the folloving fields:

mnth: Format([detcontrdate];"yy mm")
this field will group the dates by year and the month.
The second field must have the sum of the amount field from the contract details table.
 
Actually I'm trying to create records in the contracts detail table, driven off of the dates and contract amount in the Contracts table. So if a contract lasts from 01/01 to 06/01 and is worth $6,000, I want entries for each month @ $1000 per month.

Thanks anyway!
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top