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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format Australian phone numbers using format function

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
0
0
JP
Am extracting a field from an SQL database which holds phone numbers. It is integrated with a PABX phone system and the data needs to be saved as 0295554323. The data should be shown to the user in the format (02) 9555-4323.
Started by using the format function:
format(0#)####-#### it works fine.
Does anyone know of a better way of getting to the desiered result. Rather then having to force a 0 in at the start.
THe reason for this is the live database at the moment has some problems with the data being held, some of it will not even have a (02) at the start but rather just the phone number.

 
you can check the length of the field if its 10 then use your format if its 8 then use ####-####.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top