Comparison query

K

ktm400

I have several columns that contain numbers.
I want to create a query that will only display those rows which have values
that are progressivly larger...ie if column1 is less than column2 and
coulumn2 is less than column3....and so on to column10
Thanks for any help
 
J

John Spencer

Are any of the columns null (blank/empty)? If not, then this is
straightforward,

SELECT *
FROM YourTable
WHERE Column1<Column2 and Column2<Column3 ... And Column9 < Column10

In the query grid, you would need to do something like the following under
each of your columns
Field: Column1
Criteria: <[TableName].[Column2]

If you have blank columns, you can use the NZ function to force a number
smaller than any valid value. Assuming all your numbers are positive values.
Field: NZ(Column1,0)
Criteria: <Nz([TableName].[Column2],0)


The criteria should all be on one line
 
K

ktm400

Thank you John

John Spencer said:
Are any of the columns null (blank/empty)? If not, then this is
straightforward,

SELECT *
FROM YourTable
WHERE Column1<Column2 and Column2<Column3 ... And Column9 < Column10

In the query grid, you would need to do something like the following under
each of your columns
Field: Column1
Criteria: <[TableName].[Column2]

If you have blank columns, you can use the NZ function to force a number
smaller than any valid value. Assuming all your numbers are positive values.
Field: NZ(Column1,0)
Criteria: <Nz([TableName].[Column2],0)


The criteria should all be on one line
ktm400 said:
I have several columns that contain numbers.
I want to create a query that will only display those rows which have
values
that are progressivly larger...ie if column1 is less than column2 and
coulumn2 is less than column3....and so on to column10
Thanks for any help
 
Top