Hello,
The following query I'm trying to run takes a really long time. I waited 45 mins and gave up. I need this to run and return the results as quick as possible.
The SCACCT Table contains approximately 1.6 Million Records and the SCPAYM Table contains approx. 150,000 records.
Here is the query I am running.
SELECT gacct#.scacct, glast.scacct, gfirst.scacct, pdate.scpaym, payamt.scpaym, pbalaf.scpaym, gpri.scacct, gnt.scacct
FROM scdata/scpaym, scdata/scacct
INNER JOIN pguar#.scpaym=gacct#.scacct
WHERE PDATE.scpaym>=[&DateFrom] AND PDATE.scpaym<=[&DateTo]
I am using a program called ViewPoint for the AS400, but I understand the Windows version of SQL better. So if anyone can help me find a way to speed this up I would appreciate it. If you give me Windows SQL sever code, I will change it around so it works in ViewPoint. I just need some guidance.
Thanks,
John
The following query I'm trying to run takes a really long time. I waited 45 mins and gave up. I need this to run and return the results as quick as possible.
The SCACCT Table contains approximately 1.6 Million Records and the SCPAYM Table contains approx. 150,000 records.
Here is the query I am running.
SELECT gacct#.scacct, glast.scacct, gfirst.scacct, pdate.scpaym, payamt.scpaym, pbalaf.scpaym, gpri.scacct, gnt.scacct
FROM scdata/scpaym, scdata/scacct
INNER JOIN pguar#.scpaym=gacct#.scacct
WHERE PDATE.scpaym>=[&DateFrom] AND PDATE.scpaym<=[&DateTo]
I am using a program called ViewPoint for the AS400, but I understand the Windows version of SQL better. So if anyone can help me find a way to speed this up I would appreciate it. If you give me Windows SQL sever code, I will change it around so it works in ViewPoint. I just need some guidance.
Thanks,
John