I get a flat file form a customer, I import the file into a MS Access table, but somehow i need to drop the first zero form the invoice number, any help would be great
Take a look at the Mid function:
newInvoiceNumber = Mid(oldInvoiceNumber, 2)
Or more sophisticated:
If Left(oldInvoiceNumber, 1) = "0" Then
newInvoiceNumber = Mid(oldInvoiceNumber, 2)
Else
newInvoiceNumber = oldInvoiceNumber
End If
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
UPDATE yourTable
SET InvoiceNumber=Left([InvoiceNumber],InStr([InvoiceNumber],"0")-1) & Mid([InvoiceNumber],InStr([InvoiceNumber],"0")+1)
WHERE InStr([InvoiceNumber],"0") > 0
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.