Find last value after a certain date?

H

Henrootje

I have a table containing the following fields:

Saldo_ID
Saldo_Date
Saldo_Now
Saldo_Mutation

in values that would look like:
1 01-01-2005 € 100000 € 12500
2 02-01-2005 € 112500 € 32000
3 08-01-2005 € 144000 € 20

On a form I select a date (using a calendar) eg 04-01-2005.

I then need an expression (to be used in a query) that will find the
value in the column Saldo_Current belonging to the date that comes
before the selected date.

In other words, using my example, if I select 04-01-2005 I want the
result to be € 112500 (belonging to 02-01-2005, the date before my
selected date)

I thought I could do that with a domain lookup but then I would have to
use a DMAX in the criterium part of the first DLookup and it seems you
can not use a Domain function wit8hin a domainfunction?????


Any help would be greatly appreciated!

TIA, Henro
 
D

downunderling

I would limit my query to 'less then' the selected date, sorted ascending.
then goto the last record (which will be the required one)
 

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

Top