Help with Calculated Field

A

Ather Mian

I am using Acc 2K. I have a Contracts db. My query is:

Select

Contract #
Customer Name
Contract Amount
Effective Date
Expiration Date

From tContracts

Where Expiration Date > Date ()

I need three calculated fields:
Current Month Revenue = Contract Amount/Contract Length in months
Accumulated Revenue = Contract Amount/(Elapsed Month)
Future Revenue = Contract Amount-(Current Month + Accumulated Revenue)

I would greatly appreciate any help.

Thanks

Ather
 
J

John Spencer (MVP)

Select
Contract #,
Customer Name,
Contract Amount,
Effective Date,
Expiration Date
(ContractAmount/DateDiff("m",EffectiveDate,ExpirationDate) as CMRevenue,
(ContractAmount*(DateDiff("m",EffectiveDate,Date())/DateDiff("m",EffectiveDate,ExpirationDate))
as AccumRev
(ContractAmount -
(ContractAmount*(DateDiff("m",EffectiveDate,Date())/DateDiff("m",EffectiveDate,ExpirationDate))
as FutureRev
From tContracts
Where Expiration Date > Date ()

This won't be totally accurate since the formulas above are calculating based on
whole months even when only partial months have elapsed. For instance, the
DateDiff function will count 1 month for the period August 28 to Sept 2. You
might get better results calculating on the basis of 30 day months.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top