Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a field with a / 1

Status
Not open for further replies.

proximity

Technical User
Sep 19, 2002
132
GB
Hi,

I am moving from ACCESS to mySQL 5.1 and I am trying to convert some of my queries. Most of it was not too painless, but this one is driving me crackers!

I have a table with some numbers in it of the type VARCHAR(8). Now, the numbers going into this table have seven digits:
1234567
1234425
8514256

etc.

What I want to do is update these numbers so that after the third number a / is inserted, thus (which is why the field type is VARCHAR!)

123/4567
123/4425
851/4256

etc.

I'm hoping this will be super easy!! Any help, as ever, gratefully received.

--
Steven
 
Hi

Code:
[b]update[/b] your_table [b]set[/b] your_field[teal]=[/teal]insert[teal]([/teal]your_field[teal],[/teal][purple]4[/purple][teal],[/teal][purple]0[/purple][teal],[/teal][green][i]'/'[/i][/green][teal]);[/teal]

Feherke.
 
Hi feherke,

Many thanks for your help, feherke - it works brilliantly!

--
Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top