calculations in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have the following query: SELECT qryCapitalExpExclNonProject.ProjectName,
Sum(qryCapitalExpExclNonProject.[Deprn Amount]) AS [SumOfDeprn Amount],
Sum(qryCapitalExpExclNonProject.[Ytd Deprn]) AS [SumOfYtd Deprn],
Sum(qryCapitalExpExclNonProject.Cost) AS SumOfCost,
Sum(qryCapitalExpExclNonProject.Nbv) AS SumOfNbv, [Enter the monthly COF
rate, as a decimal] AS MonthlyCOFRate, [MonthlyCOFRate]*[SumOfNbv]/12 AS COF
FROM qryCapitalExpExclNonProject
GROUP BY qryCapitalExpExclNonProject.ProjectName;

The calculation, [MonthlyCOFRate]*[SumOfNbv]/12 , needs to be changed to the
following: NBV*Rate*([days in the month]/360). How would you recommend that
be done in SQL syntax?

Thanks,

Dave
 
The formula included will return the number of days in the current month.
NBV*Rate*(Day(DateAdd("d",-1,DateSerial(Year(Date),Month(Date)+1,1)))/360)
 

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

Back
Top