How do I modify the code below to select or return top (5000) records?
Another option is to return records of three months ago from today's date. How do I modify to achieve it?
var sDME = "?PROD=" + vProdLine; sDME += "&FILE=ZAP161DATA"; sDME += "&FIELD=COMPANY;VENDOR-NUMB;VENDOR-NAME;INVOICE-NUMB;INVOICE-DATE;PAYMENT-DATE;"; sDME += "PAYMENT-CODE;PAYMENT-NUMB;CASH-CODE;REMIT-TO-CODE;PAYMENT-AMT;DISCOUNT-AMT;NET-PAY-AMT;" sDME += "EMAIL-ADDRESS;EMAIL-SNT-DATE;" sDME += "EMAIL-ADDRESS;EMAIL-SNT-DATE;RUN-SEQUENCE;RUN-DATE;RUN-TIME;" sDME += "PROC-STAT-FLAG;" sDME += "&MAX=99"; if (parmtype == "V") { sDME += "&INDEX=ZAPSET6"; sDME += "&KEY=" + parmVenNumb + "=" + parmRemit + "=="; if (parmRemit != "") sDME += "&SELECT=PROC-STAT-FLAG^%21%3DNEW%26PROC-STAT-FLAG^%21%3DREST"; else sDME += "&SELECT=PROC-STAT-FLAG^%21%3DNEW%26PROC-STAT-FLAG^%21%3DREST%26REMIT-TO-CODE^%3C%3D0"; } if (parmtype == "D") { sDME += "&INDEX=ZAPSET9"; sDME += "&KEY="+ parmHistDate +"==="; sDME += "&SELECT=PROC-STAT-FLAG^%21%3DNEW%26PROC-STAT-FLAG^%21%3DREST"; }
Thanks
DME isn't SQL which allows this type of calculation. If the Index doesn't sort the data the way you need, and you can't add your own custom index, then you're pretty much out of luck. You'd have to load all of the data and use JavaScript to calculate the top 5000.
Maybe you can add a table view which applies the look up you want.