Dlookup with Last Date

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

Guest

Hi
Please Help me to find out latest Dollar rate from table whcih is have many
Dates with Dollar Rate, I want to get the Last Dollar Rate and I m writing
the following but nothing is comming; Please help.
CurrentRate = DLookup("[Rate]", "DollarRates", "[Date] = #" & DLast
("[Date]","DollarRates") & "# ")
Thanks in advance.
 
Wahab said:
Hi
Please Help me to find out latest Dollar rate from table whcih is
have many Dates with Dollar Rate, I want to get the Last Dollar Rate
and I m writing the following but nothing is comming; Please help.
CurrentRate = DLookup("[Rate]", "DollarRates", "[Date] = #" & DLast
("[Date]","DollarRates") & "# ")
Thanks in advance.

Try using the DMax function in stead. Also, you might need to ensure an
unambiguous date format, for instance (typed not tested)

CurrentRate = DLookup("[Rate]", "DollarRates", "[Date] = #" & _
Format$(DMax("[Date]","DollarRates"), "yyyy-mm-dd") & "#")
 

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