[AccessD] Query question ... Finding the proper rate/per date

John Clark John.Clark at niagaracounty.com
Wed Nov 4 13:41:34 CST 2009


I'm sorry to ask this...but I haven't written anything, aside from one very miniscule little program, in about two years, and apparently the magic is gone...I am lost. This code that Stuart offered up is exactly what I was looking to do, however, I'd like to do it from a form and what I thought I needed to do is not working. 
 
I want to (A) have the rate come up, once a given date is entered, and be there already when an old record is accessed...I want to be able to say, "this was entered on <date> and this was the rate at that time." And, (B) I want it to multiply the number of miles w/this rate and present a total. And (C) I want to do pick the going fee out of a similar table and add this to the equation. I think if I can do one of these, I can do them all.
 
How can I grab this, when a new date is entered?
 
Here is the code I am using, in the query, which works...
 
SELECT TOP 1 tblMileageRate.datDate, tblMileageRate.curMRate
'FROM tblMileageRate
'WHERE (((tblMileageRate.datDate) < [Date Entered]))
'ORDER BY tblMileageRate.datDate DESC;




More information about the AccessD mailing list