C
Christopher Scott Rodgers
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.
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.