Hi,
Our organization finds the Accpac GRNI (goods receipted not invoiced) report very inefficient so I've created a new report in SSRS which does the following:
-- RCP
SELECT
PORCPAH.TRANSDATE,
PORCPAL.PONUMBER PONUMBER,
PORCPAH.RCPNUMBER RCPNUMBER,
PORCPAH.RCPCURR CURRENCY,
POAAPC.SCEXTENDED SCEXTENDED,
POAAPC.FCEXTENDED FCEXTENDED
FROM
POAAPC
INNER JOIN
PORCPAL
ON POAAPC.DAYENDSEQ = PORCPAL.DAYENDSEQ AND
POAAPC.HEADSEQ = PORCPAL.RCPAHSEQ AND
POAAPC.LINESEQ = PORCPAL.RCPALSEQ AND
POAAPC.TRANSTYPE = 3
INNER JOIN
PORCPAH
ON PORCPAL.DAYENDSEQ = PORCPAH.DAYENDSEQ AND
PORCPAL.RCPAHSEQ = PORCPAH.RCPAHSEQ AND
PORCPAH.POSTDATE BETWEEN @intStartDate AND @intEndDate
INNER JOIN
PORCPL
ON PORCPAL.RCPLSEQ = PORCPL.RCPLSEQ
INNER JOIN
PORCPH1
ON PORCPL.RCPHSEQ = PORCPH1.RCPHSEQ
INNER JOIN
POPORH1
ON PORCPH1.PORHSEQ = POPORH1.PORHSEQ
This is only the receipts portion obviously and the logic continues across all documents, but I've come across and odd data error in one of our organizations. Basically what's happening is 7500 records in PORCPL and PORCPAL don't join by RCPLSEQ and as I put more investigation into this I see PORCPAL has a value of 0 for RCPLSEQ for these records (from almost 7 years ago).
First, is my logic sound and my assumption that these value should ALWAYS join be correct? Second, has anyone run in to anything like this before? Third, can a data purge cause this?
I'm running a data integrity check on one of our test servers to see what that's going to come back with, but that's going to take a day.
Our organization finds the Accpac GRNI (goods receipted not invoiced) report very inefficient so I've created a new report in SSRS which does the following:
-- RCP
SELECT
PORCPAH.TRANSDATE,
PORCPAL.PONUMBER PONUMBER,
PORCPAH.RCPNUMBER RCPNUMBER,
PORCPAH.RCPCURR CURRENCY,
POAAPC.SCEXTENDED SCEXTENDED,
POAAPC.FCEXTENDED FCEXTENDED
FROM
POAAPC
INNER JOIN
PORCPAL
ON POAAPC.DAYENDSEQ = PORCPAL.DAYENDSEQ AND
POAAPC.HEADSEQ = PORCPAL.RCPAHSEQ AND
POAAPC.LINESEQ = PORCPAL.RCPALSEQ AND
POAAPC.TRANSTYPE = 3
INNER JOIN
PORCPAH
ON PORCPAL.DAYENDSEQ = PORCPAH.DAYENDSEQ AND
PORCPAL.RCPAHSEQ = PORCPAH.RCPAHSEQ AND
PORCPAH.POSTDATE BETWEEN @intStartDate AND @intEndDate
INNER JOIN
PORCPL
ON PORCPAL.RCPLSEQ = PORCPL.RCPLSEQ
INNER JOIN
PORCPH1
ON PORCPL.RCPHSEQ = PORCPH1.RCPHSEQ
INNER JOIN
POPORH1
ON PORCPH1.PORHSEQ = POPORH1.PORHSEQ
This is only the receipts portion obviously and the logic continues across all documents, but I've come across and odd data error in one of our organizations. Basically what's happening is 7500 records in PORCPL and PORCPAL don't join by RCPLSEQ and as I put more investigation into this I see PORCPAL has a value of 0 for RCPLSEQ for these records (from almost 7 years ago).
First, is my logic sound and my assumption that these value should ALWAYS join be correct? Second, has anyone run in to anything like this before? Third, can a data purge cause this?
I'm running a data integrity check on one of our test servers to see what that's going to come back with, but that's going to take a day.