Sleeping on things a night can help a lot, this is actually quite simple to do 
What you do is make a table: tblDay, this table has one column only DayNR
Which contains number 0 thru 366
366 obviously for one year, if you can have periods longer than one year obviously make it 700 or 1000 or 10000
Now go to qryElapsedDays, change that to
Now all you need do is make a relatively simple query on top of that....
This you can easily query or make a parameter to only show a certain month...
Hope you get this working
P.S. One thing to take into account in all this, do you charge the exact first and last day?
In your sample database 01-01-15 to 07-02-15 is 37 days, 37 - 30 = 7 * 1.6 = 11.20
Using this new method it will count 30 thru 37 = 8 days * 1.6 = 12.80
Also just notice an additional problem in your tblDemurrageData table.
Your lower and upper range are equal this cant be.
Day 30 will be counted in the first range and the second.... instead (depending on the requirements it should be
Or
P.P.S. It may indeed be smart to add a "valid from" and "Valid to" dates to your tblDemarregeData, so you can work with any changes in the future wihtout affecting historic prices.

What you do is make a table: tblDay, this table has one column only DayNR
Which contains number 0 thru 366
366 obviously for one year, if you can have periods longer than one year obviously make it 700 or 1000 or 10000
Now go to qryElapsedDays, change that to
Code:
SELECT tblContainerMaster.Container
, tblImportVoyage.VesselDepartureDate
, tblContainerDetails.MTatWharf
, IIf(IsNull([tblContainerDetails]![MTatWharf]),(Date()-[tblImportVoyage]![VesselDepartureDate]),([tblContainerDetails]![MTatWharf]-[tblImportVoyage]![VesselDepartureDate])) AS ElapsedDays
, tblContainerType.ContainerType
, tblDay.DayNr
, [VesselDepartureDate]+[daynr] AS ChargeDay
, tblDemurrageData.DemurrageRate
FROM tblDay
, (tblImportVoyage
INNER JOIN (tblContainerType
INNER JOIN (tblContainerMaster
INNER JOIN tblContainerDetails ON tblContainerMaster.ContainerID = tblContainerDetails.Container)
ON tblContainerType.ContainerTypeID = tblContainerMaster.ContainerType)
ON tblImportVoyage.ImportVoyageID = tblContainerDetails.ImportVoyage)
INNER JOIN tblDemurrageData ON tblContainerType.ContainerType = tblDemurrageData.ContainerType
WHERE ( ( (tblDay.DayNr)>=[LowerRange]
And (tblDay.DayNr)<=[upperrange])
AND (([VesselDepartureDate]+[daynr])<=Nz([mtatwharf],Date()))
)
ORDER BY tblContainerMaster.Container, [VesselDepartureDate]+[daynr];
Now all you need do is make a relatively simple query on top of that....
Code:
SELECT qryElapsedDays.Container
, qryElapsedDays.VesselDepartureDate
, Format([ChargeDay],"yyyy/mm") AS [Month]
, Sum(qryElapsedDays.DemurrageRate) AS SomVanDemurrageRate
FROM qryElapsedDays
GROUP BY qryElapsedDays.Container
, qryElapsedDays.VesselDepartureDate
, Format([ChargeDay],"yyyy/mm")
ORDER BY qryElapsedDays.Container, Format([ChargeDay],"yyyy/mm");
This you can easily query or make a parameter to only show a certain month...
Hope you get this working

P.S. One thing to take into account in all this, do you charge the exact first and last day?
In your sample database 01-01-15 to 07-02-15 is 37 days, 37 - 30 = 7 * 1.6 = 11.20
Using this new method it will count 30 thru 37 = 8 days * 1.6 = 12.80
Also just notice an additional problem in your tblDemurrageData table.
Your lower and upper range are equal this cant be.
Code:
Lower upper
0 30
30 60
Code:
Lower upper
0 29
30 60
Code:
Lower upper
0 30
31 60
P.P.S. It may indeed be smart to add a "valid from" and "Valid to" dates to your tblDemarregeData, so you can work with any changes in the future wihtout affecting historic prices.
Last edited: