J
John
I have been fighting with this most of the day and can't seem to spot why
this will not work:
SELECT tblProjInfo.Period AS ConstPrd, Format([Period_Dte],"mmm-yy") AS
RptDte, tblProjInfo.PlanPct AS OriginalPlan, tblProjInfo.CurPCT AS
CurrentPlan,
(SELECT TOP 1 tblDupe.PlanPct FROM tblProjInfo AS tblDupe
WHERE tblDupe.Period = tblProjInfo.Period
AND tblDupe.Period < tblProjInfo.Period
ORDER BY tblDupe.Period DESC) AS PriorPCT
FROM tblProjInfo
GROUP BY tblProjInfo.Period, Format([Period_Dte],"mmm-yy"),
tblProjInfo.PlanPct, tblProjInfo.CurPCT
HAVING (((tblProjInfo.Period)>=0));
The Period field is an integer 0 - 52. The PlanPct field is a number,
formated as Percent. When this runs, all the fields show up, but there is no
data in the "PriorPCT" field (subquery), just blank.
If anyone can spot what is causing this I would be greatful...
this will not work:
SELECT tblProjInfo.Period AS ConstPrd, Format([Period_Dte],"mmm-yy") AS
RptDte, tblProjInfo.PlanPct AS OriginalPlan, tblProjInfo.CurPCT AS
CurrentPlan,
(SELECT TOP 1 tblDupe.PlanPct FROM tblProjInfo AS tblDupe
WHERE tblDupe.Period = tblProjInfo.Period
AND tblDupe.Period < tblProjInfo.Period
ORDER BY tblDupe.Period DESC) AS PriorPCT
FROM tblProjInfo
GROUP BY tblProjInfo.Period, Format([Period_Dte],"mmm-yy"),
tblProjInfo.PlanPct, tblProjInfo.CurPCT
HAVING (((tblProjInfo.Period)>=0));
The Period field is an integer 0 - 52. The PlanPct field is a number,
formated as Percent. When this runs, all the fields show up, but there is no
data in the "PriorPCT" field (subquery), just blank.
If anyone can spot what is causing this I would be greatful...