Rick Bray
2012-02-09 15:17:22 UTC
I have a query which performs a calculation and gets a number. I then need to find which of these numbers (5, 10, 20, 50, 100) that number is closest to.
I would like to do this in one query. I would think it might have to be a nest query, but that is not a strength of mine.
For example:
A = 50
B = 1.578
C = A * B (78.9)
What number is C closest to: 5, 10, 20, 50, or 100?
Return 100
I have to do this for multiple rows which is why I want to do this with a single query.
Thanks
I would like to do this in one query. I would think it might have to be a nest query, but that is not a strength of mine.
For example:
A = 50
B = 1.578
C = A * B (78.9)
What number is C closest to: 5, 10, 20, 50, or 100?
Return 100
I have to do this for multiple rows which is why I want to do this with a single query.
Thanks