<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
SPAN.EmailStyle17 {
COLOR: windowtext; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Eric</FONT></DIV>
<DIV><FONT face=Arial size=2>Why not put a 'finish date' in the table also so
that you can view historical data and then just set your query for 'finish date'
= null, thus giving only the current Territory Managers. </FONT></DIV>
<DIV><FONT face=Arial size=2>Can a Manager only be in one Territory?
With using the Manager as the PK it is very restrictive? If he
moves, do you first have to delete him from one Territory to give him
another? If he has a second term, what happens to the first
record/historical data? If you have a table autonumber as the ID and then
validate the Manager/Territory/dates in code on the before_update it may be
easier and give you a lot more control.</FONT></DIV>
<DIV><FONT face=Arial size=2>Hope this helps</FONT></DIV>
<DIV><FONT face=Arial size=2>Selina</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<HR align=center width=400 color=#df18b7 noShade>
<TABLE cellSpacing=0 cellPadding=0 width=400 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top width=10> </TD>
<TD vAlign=top width=188><FONT
face="Verdana, Arial, Helvetica, sans-serif" size=1><STRONG><FONT
color=#1a51c0>Selina Iddon </FONT><BR></STRONG><A
href="mailto:selina@easydatabases.com.au"><FONT
color=#000000>selina@easydatabases.com.au</FONT></A><BR></FONT></TD>
<TD vAlign=top width=152><FONT
face="Verdana, Arial, Helvetica, sans-serif" size=1>Ph: 0414 225
265<STRONG><BR></STRONG>Easy Access Databases </FONT></TD>
<TD vAlign=top width=50>
<DIV align=center><IMG height=33
src="http://www.digitalfunk.net/Clients/EAD/email_use/small_logo.jpg"
width=33></DIV></TD></TR></TBODY></TABLE>
<DIV align=left></DIV></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=EricGoetz@EGIsystems.com href="mailto:EricGoetz@EGIsystems.com">Eric
Goetz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=AccessD@databaseadvisors.com
href="mailto:AccessD@databaseadvisors.com">AccessD</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, February 17, 2003 8:09
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [AccessD] select most
recent</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m using AXP to work with sales
data. I have a table of sales territories and a table of sales managers. Only
one manager can be assigned to a territory at a time. The managers table has
the following fields:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ManagerID</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TerritoryID</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">LastName</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">FirstName</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">StartDate</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ManagerID is the primary key, and
TerritoryID is the foreign key. Given a date, I need to generate a list of
territories and the most recently assigned manager. I can select the manager
that started before the date.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SELECT tblTerritories.Name,
tblManagers.LastName, tblManagers.StartDate</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">FROM tblManagers RIGHT JOIN
tblTerritories ON tblManagers.TerritoryID =
tblTerritories.TerritoryID</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">WHERE
(((tblManagers.StartDate)<=[Enter Report Date]));</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I need help limiting the result to
the single most recent manager for each territory. I would greatly appreciate
any suggestions.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoAutoSig><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,</SPAN></FONT></P>
<P class=MsoAutoSig><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoAutoSig><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Eric</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></BLOCKQUOTE></BODY></HTML>