I'm using the programming below to display the sales history from one of my files. It works fine, except i get a duplicate of the first result.
For example - note below the first two lines are both from 01/19/10.
2226AA Pc Price:29.7300 Date: 01/19/10 -- Quantity: 105 2226AA Pc Price:29.7300 Date: 01/19/10 -- Quantity: 105 2226AA Pc Price: Date: 04/29/10 -- Quantity: 80 2226AA Pc Price: Date: 08/24/10 -- Quantity: 80 2226AA Pc Price: Date: 11/15/10 -- Quantity: 80 2226AA Pc Price: Date: 03/25/11 -- Quantity: 250
How do I eliminate this duplicate?
NHUser
Programming-----
var vDCNo as string var vHandle as Int var vloop as int var VNoOfRecords as Int var v1 as string var v2 as string var v3 as string var vPartNo as string var vname as string var vStatus as string var vQuantity as String var vLine as string var vTemp1 as int var vStr as string var vA as Int
#include "sbasic_include.sbas"
// View Shipment History
If @mode() = 1
{
vDCNo = @left(DC#,4) vHandle=@xResultSetSearch(@FN,"Sales", SEARCH_MODE_AND,SEARCH_SYNTAX_QA, "!PartNo="+vDCNo+"..")
XResultSetSort(vHandle,"Partno:-1;date1:-1")
vLoop=vA
If(vHandle>-1) { vNoOfRecords = @XResultSetTotal(vHandle)
If vNoOfRecords>500 then vA=vNoOfRecords-500 For vLoop= vA to vNoOfRecords xResultSetCurrentPosition(vHandle,vLoop) vPartNo = @xResultSetValue(vHandle,"PartNo") vName = @xResultSetValue(vHandle,"Diaphragms") vStatus = @xResultSetValue(vHandle,"Date1") v2 = @right(vStatus,2) v3 = @mid(vStatus,3,2) v1 = @mid(vStatus,6,2) vStatus = v1 + "/" + v2 + "/" + v3 vQuantity = @AsFormattedByLE(OverRun,0,(@xResultSetValue(vHandle,"PCS")))
// create the variable vLine=vline + vPartNo + " Date: " + vStatus + " -- Quantity: " + vQuantity+ @Newline() vTemp1=1 Next xResultSetClose(vHandle) } if vTemp1<1 { Writeln("NO PARTS ARE ON ORDER.") } else { vStr=@SortStringArray(vLine,0) Writeln(vStr) }
}
|