From: iccsi on
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,
From: Douglas J. Steele on
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 MVP
http://I.Am/DougSteele
(no private e-mails, please)


"iccsi" <inungh(a)gmail.com> wrote in message
news:ed342b45-75b0-43dc-8f4e-967f4e5e34f4(a)d1g2000hsg.googlegroups.com...
>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,


From: iccsi on
On Jul 5, 2:14 pm, "Douglas J. Steele"
<NOSPAM_djsteele(a)NOSPAM_canada.com> wrote:
> 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)
>
> "iccsi" <inu...(a)gmail.com> wrote in message
>
> news:ed342b45-75b0-43dc-8f4e-967f4e5e34f4(a)d1g2000hsg.googlegroups.com...
>
>
>
> >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,