: Well, it's a MSSQL DB, but that doesn't really matter, cause I grab the
info
: from the DB, and then work with it,in ASP code
If you're doing it in ASP and the field is text [leading zeros] then you can
just use replace:
newPhoneArea = replace(strPhoneArea,"0","27")
This assumes 0 is not used anywhere else in the area code. If it is, then:
newPhoneArea = "27" & mid(strPhoneArea,2)
HTH...
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp
Hi Roland
This is what I'm looking for, newPhoneArea = "27" & mid(strPhoneArea,2).
Casuse there would very well be 0's anywhere in any phone number. Let me
work with this, thanx. I need to be able to check if it number already has
27 in front, but that I'll be able todo with this piece of code as well
then.
Re, Ray:
| It matters because you could most likely do this with one simple UPDATE
| instead of pulling all the data into a recordset and trying to manipulate
it.
This is not really an option, cause some users enter their phone numbers
with the international syntax, and some not, also this only applies to ppl
living in South africa, so I don't want todo a DB update. I think the better
solution would be though, to check if the number has got the 27 in front,
before saving it to the DB, if not change it, and then save to the DB, which
is why Roland's stuff would work nicely.
--
Kind Regards
Rudi Ahlers
+27 (82) 926 1689
Greater love has no one than this, that he lay down his life for his friends
(John 15:13).