T
Tonk
Dear NG - Brand new to Access so I thought it would be best to try to
learn the right way right from the start.
I've used the following two queries to generate a list of names. My
instinct tells me that there is probably a more efficient and elegant
way of doing this. If you have a minute and don't mind helping out, I
sure would appreciate your feedback. The first query idenifies those
hunters who harvested 2 antlered bucks. The query captures their DL
and first and last name. I save the results of this query and then
join this query with all of the harvest-related information in
tbl2006Hrvst using DLInterface. Can this be done in a single query?
Thanks very much.
Mike
This is the first query:
SELECT tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.MiddleInitial, tbl2006Hrvst.FirstName
FROM tbl2006Hrvst
GROUP BY tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.MiddleInitial, tbl2006Hrvst.FirstName, tbl2006Hrvst.Deer
HAVING (((tbl2006Hrvst.Deer)="Antlered") AND
((Count(tbl2006Hrvst.DLInterface))=2))
ORDER BY Count(tbl2006Hrvst.DLInterface) DESC;
This is the second query:
SELECT tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.FirstName, tbl2006Hrvst.MiddleInitial,
tbl2006Hrvst.DateOfBirth, tbl2006Hrvst.City, tbl2006Hrvst.State,
tbl2006Hrvst.Zip, tbl2006Hrvst.CheckCounty, tbl2006Hrvst.CheckStation,
tbl2006Hrvst.county, tbl2006Hrvst.Metal, tbl2006Hrvst.Weapon,
tbl2006Hrvst.Deer, tbl2006Hrvst.Permit, tbl2006Hrvst.InvalidKillCheck,
tbl2006Hrvst.HarvestTimeStamp, tbl2006Hrvst.CheckTimeStamp,
tbl2006Hrvst.CheckDateStatusCode, tbl2006Hrvst.HrvstDateStatusCode,
tbl2006Hrvst.BatchNo, tbl2006Hrvst.BatchPgNo, tbl2006Hrvst.CSID,
tbl2006Hrvst.HarvestDate, tbl2006Hrvst.CheckDate,
tbl2006Hrvst.TimeOfHarvest, tbl2006Hrvst.TimeOfCheck,
tbl2006Hrvst.BatchTrackID, tbl2006Hrvst.Processed,
tbl2006Hrvst.CountyFlag, tbl2006Hrvst.CheckDateFlag,
tbl2006Hrvst.HarvestDateFlag, tbl2006Hrvst.CheckStationFlag,
tbl2006Hrvst.CheckCountyFlag, tbl2006Hrvst.WeaponFlag,
tbl2006Hrvst.DeerFlag, tbl2006Hrvst.PermitFlag,
tbl2006Hrvst.HrvstCheckStatus, tbl2006Hrvst.Vname
FROM qryMultipleBucks INNER JOIN tbl2006Hrvst ON
qryMultipleBucks.DLInterface = tbl2006Hrvst.DLInterface
WHERE (((tbl2006Hrvst.Deer)="Antlered"))
ORDER BY tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.FirstName;
learn the right way right from the start.
I've used the following two queries to generate a list of names. My
instinct tells me that there is probably a more efficient and elegant
way of doing this. If you have a minute and don't mind helping out, I
sure would appreciate your feedback. The first query idenifies those
hunters who harvested 2 antlered bucks. The query captures their DL
and first and last name. I save the results of this query and then
join this query with all of the harvest-related information in
tbl2006Hrvst using DLInterface. Can this be done in a single query?
Thanks very much.
Mike
This is the first query:
SELECT tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.MiddleInitial, tbl2006Hrvst.FirstName
FROM tbl2006Hrvst
GROUP BY tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.MiddleInitial, tbl2006Hrvst.FirstName, tbl2006Hrvst.Deer
HAVING (((tbl2006Hrvst.Deer)="Antlered") AND
((Count(tbl2006Hrvst.DLInterface))=2))
ORDER BY Count(tbl2006Hrvst.DLInterface) DESC;
This is the second query:
SELECT tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.FirstName, tbl2006Hrvst.MiddleInitial,
tbl2006Hrvst.DateOfBirth, tbl2006Hrvst.City, tbl2006Hrvst.State,
tbl2006Hrvst.Zip, tbl2006Hrvst.CheckCounty, tbl2006Hrvst.CheckStation,
tbl2006Hrvst.county, tbl2006Hrvst.Metal, tbl2006Hrvst.Weapon,
tbl2006Hrvst.Deer, tbl2006Hrvst.Permit, tbl2006Hrvst.InvalidKillCheck,
tbl2006Hrvst.HarvestTimeStamp, tbl2006Hrvst.CheckTimeStamp,
tbl2006Hrvst.CheckDateStatusCode, tbl2006Hrvst.HrvstDateStatusCode,
tbl2006Hrvst.BatchNo, tbl2006Hrvst.BatchPgNo, tbl2006Hrvst.CSID,
tbl2006Hrvst.HarvestDate, tbl2006Hrvst.CheckDate,
tbl2006Hrvst.TimeOfHarvest, tbl2006Hrvst.TimeOfCheck,
tbl2006Hrvst.BatchTrackID, tbl2006Hrvst.Processed,
tbl2006Hrvst.CountyFlag, tbl2006Hrvst.CheckDateFlag,
tbl2006Hrvst.HarvestDateFlag, tbl2006Hrvst.CheckStationFlag,
tbl2006Hrvst.CheckCountyFlag, tbl2006Hrvst.WeaponFlag,
tbl2006Hrvst.DeerFlag, tbl2006Hrvst.PermitFlag,
tbl2006Hrvst.HrvstCheckStatus, tbl2006Hrvst.Vname
FROM qryMultipleBucks INNER JOIN tbl2006Hrvst ON
qryMultipleBucks.DLInterface = tbl2006Hrvst.DLInterface
WHERE (((tbl2006Hrvst.Deer)="Antlered"))
ORDER BY tbl2006Hrvst.DLInterface, tbl2006Hrvst.LastName,
tbl2006Hrvst.FirstName;