Hi Guys,
Got another problem with prior year formulas. I am using an Oracle 9 database with Crystal Reports XI. This is the formula I am trying to edit but with no success:-
select
d.descr as department,
n.refno as bill,
m.fileid,
c.name,
c.nclient,
m.shortdescr,
au.name as author,
(n.fees + n.disb + n.antd + n.sund + n.tax) as original,
(n.fees_paid + n.disb_paid + n.antd_paid + n.sund_paid + n.tax_paid) as received,
(n.fees + n.disb + n.antd + n.sund + n.tax -
n.fees_paid - n.disb_paid - n.antd_paid - n.sund_paid - n.tax_paid) as debt,
n.dispatched,
DECODE(TRUNC(sysdate)-TRUNC(N.DISPATCHED)-120-ABS(TRUNC(sysdate)-TRUNC(N.DISPATCHED)-120),0,120,FLOOR((TRUNC(sysdate)-TRUNC(N.DISPATCHED))/30)*30) AS AGE
from
empdept d, employee au, client c, matter m, nmemo n
where
m.author = au.code and
m.nclient = c.nclient and
m.nmatter = n.nmatter and
AU.DEPT = D.CODE(+) AND
N.DISPATCHED < TRUNC(sysdate)+1
and (n.fees + n.disb + n.antd + n.sund + n.tax -
n.fees_paid - n.disb_paid - n.antd_paid - n.sund_paid - n.tax_paid) <> 0
AND (RV_TYPE = 'N' OR RV_TYPE = 'X')
AND M.DEBTORS <> 0
This give me our debtors as at the current date and split up into 30/60/90/120 days outstanding.
What I want is exactly the same for the previous year. I have tried TRUNC(SYSDATE-365,'YYYY'), plus other formulas that I have found on the net ,in place of the existing sysdate but no go. I had previously got the correct formula for prior fiscal year but this is of no good to me here as I want the actual total of debtors not just for the year.
Has anyone got any ideas??
Any help is appreciated .
Thanks
Mr Tanner
Got another problem with prior year formulas. I am using an Oracle 9 database with Crystal Reports XI. This is the formula I am trying to edit but with no success:-
select
d.descr as department,
n.refno as bill,
m.fileid,
c.name,
c.nclient,
m.shortdescr,
au.name as author,
(n.fees + n.disb + n.antd + n.sund + n.tax) as original,
(n.fees_paid + n.disb_paid + n.antd_paid + n.sund_paid + n.tax_paid) as received,
(n.fees + n.disb + n.antd + n.sund + n.tax -
n.fees_paid - n.disb_paid - n.antd_paid - n.sund_paid - n.tax_paid) as debt,
n.dispatched,
DECODE(TRUNC(sysdate)-TRUNC(N.DISPATCHED)-120-ABS(TRUNC(sysdate)-TRUNC(N.DISPATCHED)-120),0,120,FLOOR((TRUNC(sysdate)-TRUNC(N.DISPATCHED))/30)*30) AS AGE
from
empdept d, employee au, client c, matter m, nmemo n
where
m.author = au.code and
m.nclient = c.nclient and
m.nmatter = n.nmatter and
AU.DEPT = D.CODE(+) AND
N.DISPATCHED < TRUNC(sysdate)+1
and (n.fees + n.disb + n.antd + n.sund + n.tax -
n.fees_paid - n.disb_paid - n.antd_paid - n.sund_paid - n.tax_paid) <> 0
AND (RV_TYPE = 'N' OR RV_TYPE = 'X')
AND M.DEBTORS <> 0
This give me our debtors as at the current date and split up into 30/60/90/120 days outstanding.
What I want is exactly the same for the previous year. I have tried TRUNC(SYSDATE-365,'YYYY'), plus other formulas that I have found on the net ,in place of the existing sysdate but no go. I had previously got the correct formula for prior fiscal year but this is of no good to me here as I want the actual total of debtors not just for the year.
Has anyone got any ideas??
Any help is appreciated .
Thanks
Mr Tanner