Access Table Sorting/Query Last Function

M

mb

Hi,
I've been designing a database that basically works off two tables. From
the first table, I have a query that pulls information and populates the
second table. I've done this so that I can pull the last entered [Status]
for a particular [Category], [Initiative], and [Task], and use that as the
updated [Status] for all records in the second table with the same
[Category], [Initiative], and [Task]. In the first table, I have an
autonumber set for each entry as the primary key, and I've removed all
sorting and filtering from the tables. For some reason, however, entries
that are completed today and entered into the first table using a form in the
database have started from the top of the table and are inserted thereafter
instead of continuing from the bottom of all the entries in the table from
previous days. I was under the impression that if you remove the filter and
sort, the natural sort order of the table would insert new data to the bottom
of the table, which would work perfectly with the Last Function that I set up
in the query that pulls the [Status] information from the table. Since the
table is doing this weird sorting, I can't get the Last Function to work
properly; it keeps pulling the last of yesterday's Status. I've only had
this database up for a day, so I don't know how it will behave tomorrow, but
I need it to not behave like this. Can anyone help me figure this out please?
 
L

Lord Kelvan

then on your query sort by the auto number acessending and it should
resolve your last issue

as a note you should use last because last note that there is such
thing as order in a databse and there is no such thing as order in a
database your query should be

select category,status, max(somedatefield)
from thetable
group by category,status

hope this helps

Regards
Kelvan
 
K

KARL DEWEY

A couple of things. Records in a table are like a barrel of brick, there is
no order.
Sort in a query for display and for form.
Use report Grouping and Sort as a report ignores query sorts for the must
part.
 
J

Jeff Boyce

responded to in other newsgroups. please don't post the same question
redundantly.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Top