Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing records

Status
Not open for further replies.

xandre

MIS
May 21, 2001
23
US
We send mailings to principals, superintendents and athletic directors. Some schools have the same person for more than one of these jobs. How do I compare three names so I can print labels so one person with three titles only gets one packet? The way it's set up now, we are only able to compare two, then print another list with the superintendents on it, and have to manually sort them.

Please help!

xandre
 
Dear xandre
Do you have two tables: one with people and another one with people/jobs? - If that is so, construct a select query joining the two tables on the persons' ID. Select the person's ID (from either table) as a value for the first column in the query. Second column in the query should contain the job. In the criteria lines for the job write "principal", "superintendent" and "athletic director" - one expression on each line. Then click on the totals button: the persons ID "Totals:" line should say Group By, the job "Totals:" line should say Where.

Use this query as the basis for your labels report.

Regards Pavla.
 
Terry: I'm a newbie. Is this it?

SELECT DISTINCTROW First(TblforRptDistSchool.ContactFirst) AS [ContactFirst Field], First(TblforRptDistSchool.ContactLast) AS [ContactLast Field], Count(TblforRptDistSchool.ContactFirst) AS NumberOfDups
FROM TblforRptDistSchool
GROUP BY TblforRptDistSchool.ContactFirst, TblforRptDistSchool.ContactLast
HAVING (((Count(TblforRptDistSchool.ContactFirst))>1) AND ((Count(TblforRptDistSchool.ContactLast))>1));


Pavla: We have one table that has principal's names, athletic director's names, and the school address... and a second table that has the superintendent and his address. Sometimes the superintendent's address is the same as the school's address.

I'm just starting out, but it seems to me that this isn't very logical...?

xandre
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top