The simplest answer is for you to create a uery that returns the lowest value. At that point, you can use it as your source for the main query.
A bit more detail is necessary for us to move forward.
Regards,
Bill Mosca,
Founder, MS_Access_Professionals
MS Access MVP 2006-2016
That'll do IT http://thatlldoit.com
My Nothing-to-do-with-Access blog
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Thursday, May 10, 2018 7:22 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] help with my query
I have the following query:
UPDATE DISTINCTROW crwksuma INNER JOIN MLTC ON crwksuma.[patient id] = MLTC.patientid SET crwksuma.insrcd = " ", crwksuma.[billing type] = "M"
WHERE [mltc].[enrollmentdate]>[Forms]![zformcrwk]![pid to];
The query works, but '[mltc].[enrollmentdate]' can have multiple entries and I only want to use the lowest one. If I use the MIN() function, I get error 'cannot have aggregate function in WHERE clause.'.
Is there any way to do this in the above query or do I need to do it differently.
Thanks for your help.
Sarah
Posted by: "Bill Mosca" <wrmosca@comcast.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (19) |
Tidak ada komentar:
Posting Komentar