Help with SQL statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
LouD,

On the assumption that the part number is always 7 characters...
UPDATE YourTable SET YourField = Mid(YourField,3,7) & " " &
Mid(YourField,9)
 
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.
 
Sorry,
The error actually states, "not a recognized function name", not invalid
syntax as I said previously.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top