M
Mihai Zamfirescu
I have a database with the progress history of data:
for same jobnum I have records with increased periodnumber and periodend.
The query create a view with jobnum, periodend and periodnumber of previous
record for records with periodend = last friday:
SELECT jc.Jobnum, jc.periodnumber, Max(jc1.periodnumber) AS PrevPeriod
FROM jobcardprogresshistory AS jc LEFT JOIN jobcardprogresshistory AS jc1 ON
(jc.Jobnum = jc1.Jobnum) AND (jc.periodnumber > nz(jc1.periodnumber))
WHERE jc.periodend=Date()-weekday(date(),7) mod 7
GROUP BY jc.Jobnum, jc.periodnumber;
When I run the query I receive a window with the message:
"SQL Statement.periodend".
1. Why and how can I avoid this?
2. Is other more elegant method to create the query?
Thanx!
for same jobnum I have records with increased periodnumber and periodend.
The query create a view with jobnum, periodend and periodnumber of previous
record for records with periodend = last friday:
SELECT jc.Jobnum, jc.periodnumber, Max(jc1.periodnumber) AS PrevPeriod
FROM jobcardprogresshistory AS jc LEFT JOIN jobcardprogresshistory AS jc1 ON
(jc.Jobnum = jc1.Jobnum) AND (jc.periodnumber > nz(jc1.periodnumber))
WHERE jc.periodend=Date()-weekday(date(),7) mod 7
GROUP BY jc.Jobnum, jc.periodnumber;
When I run the query I receive a window with the message:
"SQL Statement.periodend".
1. Why and how can I avoid this?
2. Is other more elegant method to create the query?
Thanx!