M
Mike C
Hello,
I have a table containing a list of businesses and some general info. One
of the fields in my table is TotalAssets. What I want to do is create a
query that selects the 10 rows above and below a TargetAsset parameter that
is input by the user.
Currently I am using two "SELECT TOP 10..." queries, one that looks for the
10 just above and the other that looks for the 10 below the TargetAssets. I
use a UNION query to join the two statements together. It works just fine,
however it causes an extra bit of complexity to my query design and vba
programming and makes my project much more difficult because of a specific
way I need my query to output. Not to mention any change I would have to
make to the statement needs to be made twice to accomidate both SELECT
statements.
Is there an easier way to do this by using only one SELECT statement? Any
thoughts are appreciated.
-Mike C
I have a table containing a list of businesses and some general info. One
of the fields in my table is TotalAssets. What I want to do is create a
query that selects the 10 rows above and below a TargetAsset parameter that
is input by the user.
Currently I am using two "SELECT TOP 10..." queries, one that looks for the
10 just above and the other that looks for the 10 below the TargetAssets. I
use a UNION query to join the two statements together. It works just fine,
however it causes an extra bit of complexity to my query design and vba
programming and makes my project much more difficult because of a specific
way I need my query to output. Not to mention any change I would have to
make to the statement needs to be made twice to accomidate both SELECT
statements.
Is there an easier way to do this by using only one SELECT statement? Any
thoughts are appreciated.
-Mike C