MS Access returns different results each time

Hello,
I am puzzled.
This query:

SELECT DISTINCTROW Last(dbo_INVENTORY_TRANS.TRANSACTION_DATE) AS LastOfTRANSACTION_DATE, dbo_INVENTORY_TRANS.PART_ID
FROM dbo_INVENTORY_TRANS
GROUP BY dbo_INVENTORY_TRANS.PART_ID
HAVING (((Last(dbo_INVENTORY_TRANS.TRANSACTION_DATE))>#12/31/2012#) AND ((dbo_INVENTORY_TRANS.PART_ID) Is Not Null))
ORDER BY Last(dbo_INVENTORY_TRANS.TRANSACTION_DATE) DESC , dbo_INVENTORY_TRANS.PART_ID;

gives me different results each time I click Run.
The database is linked using ODBC to our ERP database. Nobody is logged in to the ERP, so no transactions are going on.
Difference between each time can come to almost thousand records.

What am I doing wrong?

Microsoft Access 2013. SQL Server 2007.
MezczyznaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
You should use Max instead of last.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ste5anSenior DeveloperCommented:
What do you want to achieve y using LAST()? Do you run it in Access or SQL Server?
0
MezczyznaAuthor Commented:
I think I tried, but I will again.
Thank you.
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

MezczyznaAuthor Commented:
I want the most recent transaction record on a part.
0
MezczyznaAuthor Commented:
Max gives me the same number of records each time.
If max is the solution to display the most recent record for inventory transaction, this is the solution.

Thank you.
0
MezczyznaAuthor Commented:
Thank you, max solved the issue.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.