find value not greater than

  • Thread starter Thread starter Souris
  • Start date Start date
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,
 
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
 
Back
Top