Comparison query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

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

Back
Top