Solved Access criteria (1 Viewer)

teemax

New member
Local time
Today, 01:20
Joined
Apr 12, 2024
Messages
5
Hi, I am having issues with the criteria for the query. The instructions are as follows
Display all fields for all products with a selling price greater than $10.00 and the number on hand is fewer than 10

Sort the query in ascending order according to the Cost field.

Save this query as qry_Inventory_L10
However when i save the query and open the data. I am not getting the correct information
Please see snipping below:

1712936021367.png

1712935971640.png

1712935795389.png
 

plog

Banishment Pending
Local time
Today, 01:20
Joined
May 11, 2011
Messages
11,653
Use the right datatype for your data.

[On Hand] is a text field in your database, it should be a numeric field. Comparisons on text are different than comparisons on numbers. When you use > or < on text it does it character by character. That means:

"10" < "3" because "1" is less than "3"

As numbers, it does it value by value:

10 > 3 because it looks at the whole thing numerically.

So, you need to make [On Hand] a numeric datatype if you want to do numeric comparsions.

While you're changing your table, I suggest you also eliminate spaces in field names (On Hand = OnHand, Selling Price = SellinPrice). It'll make coding and querying easier.
 

teemax

New member
Local time
Today, 01:20
Joined
Apr 12, 2024
Messages
5
Thank you, One more question as it relates to the same data but a different query. I am unsure of how to do this question .
Create a query that calculates and displays the average items On Hand in inventory by Supplier Code. Select the following fields for the query; Supplier Code, On Hand.

Sort the query in ascending order according to the Supplier Code field.

Save this query as qry_Avg_on_Hand
 

plog

Banishment Pending
Local time
Today, 01:20
Joined
May 11, 2011
Messages
11,653
When you need to group data together that's called an aggregate query. One of the functions available when you do that is AVG. Give this link a read:


Then try it on your data, if you have any issues post back here the SQL you tried and what the issue is.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:20
Joined
Sep 12, 2006
Messages
15,660
What would "average items on hand" mean with reference to inventory? It seems a curious measure.
 

teemax

New member
Local time
Today, 01:20
Joined
Apr 12, 2024
Messages
5
What would "average items on hand" mean with reference to inventory? It seems a curious measure.
i am still trying to understand the question my self, despite reading how to sum data by query. But initially the question ask me to create a query showing the inventory value by (on hand * cost) which is displayed in the pic below. The second question is asking for me to create a query that calculates and displays the average items On Hand in inventory by Supplier Code

1712968690904.png
 

teemax

New member
Local time
Today, 01:20
Joined
Apr 12, 2024
Messages
5
What would "average items on hand" mean with reference to inventory? It seems a curious measure.
But the on hand is basically the amount of items they have in stock, So i think the question is asking me to average the amount of item that is in stock by the supplier code. I finally got it . Thank you guys

1712970761226.png
 

Attachments

  • 1712970751345.png
    1712970751345.png
    12.5 KB · Views: 10
Last edited:

Users who are viewing this thread

Top Bottom