Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AR Aging report

Status
Not open for further replies.
May 12, 2016
2
US
I need to extract the same data set as the AR Aging report using SQL SELECT statement. Below is my SQL SELECT statement. I have been looking through the arrept.prg file but cant find the missing piece. I am returning too many records that the ar aging report does not have. I am using VBS to create the data set.

sql="Select CUSTNO,INVNO,INVDTE,BALANCE,PNET,ARSTAT"&_
" INVAMT,DTEPAID,ARTYPE,SALESMN,ORNUM,PONUM,REFNO"&_
" from ARYMST01 where balance <> 0 and arstat <> 'V' "&_
" union "&_
" Select CUSTNO,INVNO,INVDTE,BALANCE,PNET,ARSTAT"&_
" INVAMT,DTEPAID,ARTYPE,SALESMN,ORNUM,PONUM,REFNO"&_
" from ARMAST01 where balance <> 0 and arstat <> 'V' "&_
" order by CUSTNO"

thank you
Paul
 
That's not for Sage 300, which program are you using?
In Sage 300 you can run the aging view AR0055 and then query the ARAGED table, that will give you exactly what you need.

Sage 300 Certified Consultant
 
That's from Sage Pro (PFW). You're showing a union query with the same parameters, which will double everything up.
 
Sage Pro and Sage PFW are 2 different programs ;)

Sage 300 Certified Consultant
 
The program is SBT using foxpro. The join is for the current ARMAST table and the history ATMAST table, we need all records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top