Jack
Jack

Reputation: 67

How do you filter a certain number and find the range on Microsoft Access when using min/max on Query (filter button does not work in this case)?

For class, I was required to find the range of the convicts but some of the ages are -1 because it is unknown.

How do I filter the -1 and use the lowest positive number?

Here are some pictures explaining what doesn’t work and what the result is when I try it.

This is my database:

This is how it looks:

What doesn't work?

I spent three lessons trying to solve this, please help!

EDIT:

The edited one

Upvotes: 0

Views: 669

Answers (1)

AHeyne
AHeyne

Reputation: 3455

This looks fine for me:

SELECT
    Min([Age leaving england]) AS MinAge,
    Max([Age leaving england]) AS MaxAge
FROM
    Convicts
WHERE
    [Age leaving england] <> -1

To use it, switch the view of your query to sql and paste the query.

Edit:

This is how the query looks in design view:

Upvotes: 1

Related Questions