Table is tblReview
Fields are Pln#
PN
CND
Date Rcvd
SELECT tblReview.[Pln#], Last(tblReview.PN) AS LastOfPN, Max(tblReview.CND)AS MaxOfCND,Last(tblReview.[Date Rcvd]) AS [LastOfDate Rcvd]
FROM tblReview
GROUP BY tblReview.[Pln#]
HAVING (((Max(tblReview.CND))>”0”))
ORDER BY Max(tblReview.CND), Last(tblReview.[Date Rcvd]) DESC,
Below is actual result of QUERY
PlanLog
Plan # LastOfPN MaxOfCND LastOfDate Rcvd
04-0126 Gotoh 001 7/21/2004
03-0081 KFC/Long John Silvers 001 7/14/2003
02-0030 Kaufman Tire, Inc 001 3/4/2002
04-0049 First Baptist Mission 002 4/14/2004
03-0043 Stratford@Battlecreek 002 4/14/2003
02-0098 Waterworks Car Wash 002 5/21/2002
04-0129 Schencker, Inc 003 7/23/2004
02-0155 TS Office & W'house'A' 003 8/9/2002
02-0156 TS Office & W.house'B' 003 8/9/2002
02-0157 TS Office & W'house'C' 003 8/9/2002
03-0128 Sri-Siva Temple 004 11/3/2003
02-0151 Hindu Temple Add #1 004 8/7/2002
04-0130 RCS@SouthPark-Bldg U 005 7/26/2004
02-0128 FOFMBaptist Church 005 7/1/2002
02-0178 S'woods Dist Bldg 800 006 9/12/2002
What I am trying to get out of this query is the CND field as MAX and the Date Rcvd field as the LAST input for CND Example
PlanLog
Plan # LastOfPN MaxOfCND LastOfDate Rcvd
04-0126 Gotoh 001 7/21/2004
04-0049 First Baptist Mission 002 4/14/2004
04-0129 Schencker, Inc 003 7/23/2004
03-0128 Sri-Siva Temple 004 11/3/2003
04-0130 RCS@SouthPark-Bldg U 005 7/26/2004
02-0178 S'woods Dist Bldg 800 006 9/12/2002
I’ve moved, switched & replaced the MAX & LAST statements with no results, if you know an easy way to do this, please help. Thanks in advance.
Fields are Pln#
PN
CND
Date Rcvd
SELECT tblReview.[Pln#], Last(tblReview.PN) AS LastOfPN, Max(tblReview.CND)AS MaxOfCND,Last(tblReview.[Date Rcvd]) AS [LastOfDate Rcvd]
FROM tblReview
GROUP BY tblReview.[Pln#]
HAVING (((Max(tblReview.CND))>”0”))
ORDER BY Max(tblReview.CND), Last(tblReview.[Date Rcvd]) DESC,
Below is actual result of QUERY
PlanLog
Plan # LastOfPN MaxOfCND LastOfDate Rcvd
04-0126 Gotoh 001 7/21/2004
03-0081 KFC/Long John Silvers 001 7/14/2003
02-0030 Kaufman Tire, Inc 001 3/4/2002
04-0049 First Baptist Mission 002 4/14/2004
03-0043 Stratford@Battlecreek 002 4/14/2003
02-0098 Waterworks Car Wash 002 5/21/2002
04-0129 Schencker, Inc 003 7/23/2004
02-0155 TS Office & W'house'A' 003 8/9/2002
02-0156 TS Office & W.house'B' 003 8/9/2002
02-0157 TS Office & W'house'C' 003 8/9/2002
03-0128 Sri-Siva Temple 004 11/3/2003
02-0151 Hindu Temple Add #1 004 8/7/2002
04-0130 RCS@SouthPark-Bldg U 005 7/26/2004
02-0128 FOFMBaptist Church 005 7/1/2002
02-0178 S'woods Dist Bldg 800 006 9/12/2002
What I am trying to get out of this query is the CND field as MAX and the Date Rcvd field as the LAST input for CND Example
PlanLog
Plan # LastOfPN MaxOfCND LastOfDate Rcvd
04-0126 Gotoh 001 7/21/2004
04-0049 First Baptist Mission 002 4/14/2004
04-0129 Schencker, Inc 003 7/23/2004
03-0128 Sri-Siva Temple 004 11/3/2003
04-0130 RCS@SouthPark-Bldg U 005 7/26/2004
02-0178 S'woods Dist Bldg 800 006 9/12/2002
I’ve moved, switched & replaced the MAX & LAST statements with no results, if you know an easy way to do this, please help. Thanks in advance.