Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Max query results
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
MaRSMAN  
View profile  
 More options Jan 30 2010, 4:08 pm
Newsgroups: microsoft.public.access.queries
From: MaRSMAN <MaRS...@discussions.microsoft.com>
Date: Sat, 30 Jan 2010 13:08:01 -0800
Local: Sat, Jan 30 2010 4:08 pm
Subject: Max query results
Table is Communion
fldCommunionID  autonumber
fldCommunionDate    date
fldCommunicant    number       relaated to tblSouls  fldSoulID
I would like a query to show the groupby communicant and then select each
communicants max date and update that communionDate to a fldLastCommuned in
the tablequerySouls Extended
would this work best as a mudular VBA code I am not to good at doing VBA
code yet
Thanks in advance to ALL who help me out on this

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pietlinden@hotmail.com  
View profile  
 More options Jan 31 2010, 12:43 am
Newsgroups: microsoft.public.access.queries
From: "pietlin...@hotmail.com" <pietlin...@hotmail.com>
Date: Sat, 30 Jan 2010 21:43:02 -0800 (PST)
Local: Sun, Jan 31 2010 12:43 am
Subject: Re: Max query results
On Jan 30, 3:08 pm, MaRSMAN <MaRS...@discussions.microsoft.com> wrote:

> Table is Communion
> fldCommunionID  autonumber
> fldCommunionDate    date
> fldCommunicant    number       relaated to tblSouls  fldSoulID
> I would like a query to show the groupby communicant and then select each
> communicants max date and update that communionDate to a fldLastCommuned in
> the tablequerySouls Extended
> would this work best as a mudular VBA code I am not to good at doing VBA
> code yet
> Thanks in advance to ALL who help me out on this

Either I'm missing something or your question does not make sense.
Unless you're storing the "LastCommuned" date somewhere (WHY???  You
can use a SQL statement to calculate it for you on the fly!)

If you just calculate on the fly, you don't need any code at all.
What did you need to do with this?  If you're going to do a mail merge
or similar, you can just create another query and include both the
ChurchMember table (or whatever you call it) and this totals query and
include other values.  Michel Walsh has an article on this at
www.mvps.org/access


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MaRSMAN  
View profile  
 More options Jan 31 2010, 12:34 pm
Newsgroups: microsoft.public.access.queries
From: MaRSMAN <MaRS...@discussions.microsoft.com>
Date: Sun, 31 Jan 2010 09:34:01 -0800
Local: Sun, Jan 31 2010 12:34 pm
Subject: Re: Max query results
SQL is what i want  
The first part is to get the max communion date for each churchmember from
thecommunion table    the next step is to take the max communion date from
each church member and update the fld Lastcommuned that is located in the
churchmember table.
Hope this clarifies better also please note I am using Access 2007
An Example woould help me out


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PieterLinden via AccessMonster.com  
View profile  
 More options Jan 31 2010, 1:38 pm
Newsgroups: microsoft.public.access.queries
From: "PieterLinden via AccessMonster.com" <u49887@uwe>
Date: Sun, 31 Jan 2010 18:38:21 GMT
Local: Sun, Jan 31 2010 1:38 pm
Subject: Re: Max query results
If you can calculate LastCommuned, why store it at all?  You would be better
off just calculating it on the fly. Storing it is just asking for trouble...

 Assuming you have a structure like

CREATE TABLE Communion(
   ChurchMemberID  INT NOT NULL,
   CommunionDate   DATE NOT NULL,
   PRIMARY KEY (ChurchMemberID, CommunionDate)
)

doing the following will give you the last CommunionDate for each member.

SELECT ChurchMemberID, Max([CommunionDate])
FROM tblMember LEFT JOIN tblCommunion ON tblMember.MemberID = tblCommunion.
ChurchMemberID
ORDER BY ChurchMemberID
GROUP BY ChurchMemberID;

Then you can join that query back to the Members table on ChurchMemberID, and
get the member's name, address, and all that ...

(Hey, John... tell him why storing derived/calculated values is a bad idea...)

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201001/1


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »