Help with SQL statement

L

LouD

Hello,
Could anyone tell me what the sql statement would be to trim some characters
from the beginning of data, as well as adding a space in the middle?

I scan barcodes that contain part numbers and serial numbers. The first two
characters need to be dropped, and I need to seperate the part number from
the serial number with a space.

For example:
IS02R206878X6246 would become 02R2068 78X6246
 
S

Steve Schapel

LouD,

On the assumption that the part number is always 7 characters...
UPDATE YourTable SET YourField = Mid(YourField,3,7) & " " &
Mid(YourField,9)
 
L

LouD

Thanks Steve,
But I keep getting an error stating that Mid is not valid syntax.
I apologize if I didn't give you enough info.
This statement is being applied to a web page created with Frontpage, which
has a custom query that updates tables on the server.
 
L

LouD

Sorry,
The error actually states, "not a recognized function name", not invalid
syntax as I said previously.
 
L

LouD

The actual statement that works is as follows:
UPDATE [yourtable]
SET [field in table]=substring('::field on web page::',3,7)+'
'+right('::field on webpage::',7)

Thank you for your help Steve. It put me in the right direction.
 
Top