Jump to content
  • 0

Triggered action to replace leading character in string on insert



Hello all,

So I have been going round in circles with this and have admitted I need help!

This is in the UK and we have phone numbers and other information uploaded into a table using EasyCSV, the problem is the numbers need to be formatted with no spaces (have this bit covered) and start with 44 (UK dialling code) for use in an external system. The field that stores the number is formatted as text and unfortunately numbers often sometimes get uploaded as 07111 022096 (no idea if this number exists just a random example of format) when the required format would be 447111022096

What I need is a trigger on insert of data to the table to check if the first number is a 0 and if so replace with 44 if it is, I have tried various methods but end up replacing all the 0's in the string with 44 so it ends up looking something like 44711144224496 :wacko:

Any help would be greatly appreciated cheers, Roosta

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...