dlookup

I

iccsi

I have following data

MyCode MyValue

A 1
B 2
C 3
D 4
E 0

I just wonder if I use Dlookup("[MyCode]","MyTable", "[MyValue] <= "
3)
which record will return A, B or C or unknonw?


Because A, B and C are less or equal 3, does Dlookup return the most
close one "C"?
If I use MyValue < 3 then returns "B" or any one less then 3?


Your information is great appreciated,
 
D

Douglas J. Steele

It will return one of the three values. Which one, however, is essentially
unknown and depends on a number of things.

If you want it to always return C (the highest value), use DMax instead of
DLookup. If you want it to always return A (the lowest value), use DMin.
(There's no way to have it reliably return B)
 
I

iccsi

It will return one of the three values. Which one, however, is essentially
unknown and depends on a number of things.

If you want it to always return C (the highest value), use DMax instead of
DLookup. If you want it to always return A (the lowest value), use DMin.
(There's no way to have it reliably return B)

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)




I have following data
MyCode  MyValue
 A         1
 B         2
 C         3
 D         4
 E         0
I just wonder if I use Dlookup("[MyCode]","MyTable", "[MyValue] <= "
3)
which record will return A, B or C  or unknonw?
Because A, B and C are less or equal 3, does Dlookup return the most
close one "C"?
If I use MyValue < 3 then returns "B" or any one less then 3?
Your information is great appreciated,- Hide quoted text -

- Show quoted text -

Thanks millions,
 

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