find value not greater than

S

Souris

I am looking a function to look a value in the table not great thean the value.

are there any function does this?

For example:

The table is

ID Value
1 69.9
2 79.9
3 84.9
4 89.9
5 94.9


I want to return ID depends on value which not exactly same in the table.
I beleive that DLookup must have exactly value.


Your information is great appreciated,
 
D

Dale Fye

How about something like:

SELECT Top 1 ID
FROM yourTable
WHERE [ValueField] < DAVG("ValueField", "YourTable")
ORDER BY DAVG("ValueField", "YourTable") - [ValueField]

I think Value is an Access reserved word, so if you are going to use it as a
field name (would recommend against it), then you should wrap it in brackets
whenever you use it.

HTH
Dale
 

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