Only Return MAX AutoNum From relational Records
- From: "Christopher Scott Rodgers" <u28402@uwe>
- Date: Fri, 27 Oct 2006 20:23:52 GMT
HI,
I have the following problem (one of many).
***I am trying to return the latest marketing event from a table. ****
tblMarketing has fields like
autoNumMarketing,
MarketingComments,
DateOfContact and
AutoNumAgy which can be related many times to AutoNmAgy in tblAgency.
tblAgency also has other fields such as
intLevel,
State_county,
DateOfContact - to name a few.
I am using the following sql to gather records in a query
SELECT tblAgency.SalesType, tblAgency.IntLevel, tblAgency.State_County,
tblAgency.ContrType, tblAgency.ServiceOpps, tblMarketing.MarketingComments,
tblAgency.SalesLead, tblMarketing.DateOfContact, tblAgency.EstValue,
tblAgency.EstPrjStart, tblMarketing.AutoNumMarketing
FROM tblAgency INNER JOIN tblMarketing ON tblAgency.AutoNumAgy = tblMarketing.
AutoNumAgy
WHERE (((tblAgency.SalesType)="New-Open") AND ((tblAgency.IntLevel)
="Interested - Seeking Approval" Or (tblAgency.IntLevel)="Verbal Commitment"
Or (tblAgency.IntLevel)="Interested - Requested More Information"));
I have read through a thread from "Roger Tregelles" and found it very useful -
I was able to apply it and limit my returned records to one, however I can
not seem to limit the recordset to one record (the latest) from each
different agency. The inner join is giving me some trouble.
Any help would be greatly appreciated.
.
- Prev by Date: Re: Report Selection from Po-Up Choice?
- Next by Date: RE: Need help calculating time query
- Previous by thread: Re: Can I put a comment in SQL code of an Access Query, how?
- Next by thread: RE: Only Return MAX AutoNum From relational Records
- Index(es):