Solved Missing record in query (2 Viewers)

Gasman

Enthusiastic Amateur
Local time
Today, 10:00
Joined
Sep 21, 2011
Messages
14,301
Hi all,
Not sure what is going one here.
I have a query qryFoodPerDay which I just use to review how much I have had of a particular food.
As it is just for me, I use an Input Box and enter the FoodID required.

So tonight I picked 191 foodID.
If you look in the table tblDaily there is a factor of 2 (meaning I have had 2 of them) on this day.
Yet when I run the query there is no entry for today.

There is no date filter in the query.
So what I am I missing, that it does not show the food 191 used today.? :(
 

Attachments

  • Food.accdb
    536 KB · Views: 51

Edgar_

Active member
Local time
Today, 04:00
Joined
Jul 8, 2023
Messages
430
It shows up for me.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    48.1 KB · Views: 41

Gasman

Enthusiastic Amateur
Local time
Today, 10:00
Joined
Sep 21, 2011
Messages
14,301
Now that is wierd?
1692045914998.png


OK, I see what is happening. :(
Sorry. I was looking at the bottom of the query output as the entries would be in date order with no sorting.
Why it appears at the top I have no idea?

Thank you for pointing that out. I was looking in completely the wrong area. :(
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:00
Joined
Feb 19, 2002
Messages
43,275
Why it appears at the top I have no idea?
Queries and tables are unordered sets. You can only rely on a particular sequence if you have a set of columns that produces a unique result and you sort on that. If you have 5 people named John Smith, they might be returned in a different order today than they were yesterday (more likely with SQL Server than Jet/ACE) but if you include middle name and that makes the combination of the three fields, unique, the order will always be predictable. Access tends to fool people because every time you C&R the BE, Access rewrites all tables in PK order and all indexes in whatever columns are indexed order. So, we open a query or a table and we see a few rows and they are always the same rows so we think it is ever thus. Until it isn't;)
 

Users who are viewing this thread

Top Bottom