M
M Skabialka
How do I write a DLOOKUP in code which will find the correct
effective date and its load factor, if I can pass as parameters the
ResourceType, ChargeDate and CompanyName?
CurrentLoadFactor = DLOOKUP("LoadFactor", "tblLoadFactor", & _
"[ResourceType] = '" & rs![ResourceType] & "' and " & _
"[CompanyName] = " & rs![CompanyName] & "' and " & _
"[Effective date]
.............??........rs![ChargeDate]...........??.................)
I need to find the closest effective date prior to the ChargeDate, then
return the LoadFactor.
ResourceType EffectiveDate LoadFactor CompanyName
FEF 1/1/02 1.0424 ABC
FEF 1/1/02 1.15788 XYZ
FEF 1/1/03 1.15053 XYZ
FEF 1/1/03 1.0299 ABC
FEF 1/1/04 1.0234 ABC
FEF 1/1/04 1.1461 XYZ
MTS 1/1/02 1.0424 XYZ
MTS 1/1/02 1.0424 ABC
MTS 1/1/03 1.0299 ABC
MTS 1/1/03 1.0299 XYZ
MTS 1/1/04 1.0234 ABC
MTS 1/1/04 1.0234 XYZ
Thanks,
Mich
effective date and its load factor, if I can pass as parameters the
ResourceType, ChargeDate and CompanyName?
CurrentLoadFactor = DLOOKUP("LoadFactor", "tblLoadFactor", & _
"[ResourceType] = '" & rs![ResourceType] & "' and " & _
"[CompanyName] = " & rs![CompanyName] & "' and " & _
"[Effective date]
.............??........rs![ChargeDate]...........??.................)
I need to find the closest effective date prior to the ChargeDate, then
return the LoadFactor.
ResourceType EffectiveDate LoadFactor CompanyName
FEF 1/1/02 1.0424 ABC
FEF 1/1/02 1.15788 XYZ
FEF 1/1/03 1.15053 XYZ
FEF 1/1/03 1.0299 ABC
FEF 1/1/04 1.0234 ABC
FEF 1/1/04 1.1461 XYZ
MTS 1/1/02 1.0424 XYZ
MTS 1/1/02 1.0424 ABC
MTS 1/1/03 1.0299 ABC
MTS 1/1/03 1.0299 XYZ
MTS 1/1/04 1.0234 ABC
MTS 1/1/04 1.0234 XYZ
Thanks,
Mich