Thanks Niels for the heads up re "DAY"
FYI
The Code is now sorted , provided the date column in the CSV file is changed to dd/mm/yyyy
herewith for your interest
SET(Lineitems)
Access:Lineitems.usefile
OPEN (Lineitems)
Relate:ImportCSV.OPEN
SET(ImportCSV)
LOOP until Access:ImportCSV.Next()
Lin:UserName = p_web.GSV('Username')
Lin:Quantity = 1
Lin:Product = ImpCSV:Label3
Lin:Price = ImpCSV:Label6
Lin:IncomeItem = 0
IF Lin:Price > 1 THEN Lin:IncomeItem = 1 END
IF LIN:Price < 1 THEN LIN:Price = (LIN:Price * -1 ) END
Lin:Total = Lin:Price
Lin:date = deformat( ImpCSV:Label7),@D6)
locNewDate = LIN:Date
locdaydate = DAY(Lin:Date)
LIN:Date = (locNewDate - locdaydate) +1
INV:Date = Lin:date
IF access:Invoice.Fetch(INV:byDateDescending) = LEVEL:Benign
Lin:InvoiceNumber = INV:ID
END
Access:LineItems.Insert()
END
loc:Alert = 'Your Bank Statement has been Imported.'
Regards,
Richard