Here's what I need...
My simple query looks like this....
SELECT acctnum, checknum, postdate, amt
FROM trans
WHERE checknum is not null
AND postdate between '30-JAN-06' AND '02-FEB-06'
GROUP BY acctnum, checknum, postdate, amt
ORDER BY acctnum, checknum
...I need to create a report that identifies checks that clear an account during any given week that are off by
more than 100 check numbers. For example, check # 821 clears October 26 and then check # 989 clears on October 28. This would be identified in the report as a warning sign for review.
I posted this in a different forum and the most recent reply was ...
SELECT a.acctnum, checknum, postdate, amt
FROM trans t,
(select acctnum from trans WHERE checknum is not null
AND postdate >= '30-JAN-06' AND postdate <= '02-FEB-06' and max(checknum)- Min(checknum)>100
group by acctnum) a
WHERE t.acctnum = a.acctnum
ORDER BY a.acctnum, checknum
...but this query comes back with a...
"ORA-00934: group function is not allowed here"
Please advise.
Thanks,
Darrel
My simple query looks like this....
SELECT acctnum, checknum, postdate, amt
FROM trans
WHERE checknum is not null
AND postdate between '30-JAN-06' AND '02-FEB-06'
GROUP BY acctnum, checknum, postdate, amt
ORDER BY acctnum, checknum
...I need to create a report that identifies checks that clear an account during any given week that are off by
more than 100 check numbers. For example, check # 821 clears October 26 and then check # 989 clears on October 28. This would be identified in the report as a warning sign for review.
I posted this in a different forum and the most recent reply was ...
SELECT a.acctnum, checknum, postdate, amt
FROM trans t,
(select acctnum from trans WHERE checknum is not null
AND postdate >= '30-JAN-06' AND postdate <= '02-FEB-06' and max(checknum)- Min(checknum)>100
group by acctnum) a
WHERE t.acctnum = a.acctnum
ORDER BY a.acctnum, checknum
...but this query comes back with a...
"ORA-00934: group function is not allowed here"
Please advise.
Thanks,
Darrel