in sql
('(' + SUBSTRING(AS.TELEPHONE, 1,3) + ') ' + SUBSTRING(AS.TELEPHONE,4,3) +
'-' + SUBSTRING(AS.TELEPHONE,7,4)) AS TELEPHONE
or as a cfset
<CFSET TELEPHONE="(#left(SchoolInfo.TELEPHONE,3)#)
#mid(School.TELEPHONE,4,3)#-#mid(School.TELEPHONE,7,4)#">
-----Original Message-----
From: Burcham, Steve [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 3:27 PM
To: CF-Talk
Subject: Phone Number Format
I have a column in a SQL database called COMP_PHONE, it is a char data type.
Right now the phone number is in the database as 1234567890.
I want to output this as (123) 456-7980 in my application. I have tried
using NumberFormat to no avail. I get an error message when I run the code
stating the format is invalid.
Here is the code I was using:
#NumberFormat(COMP_PHONE, '(999)999-9999')#
Any suggestions would be appreciated.
Thank you.
Steve Burcham
Webmaster - Field Support Team
RDO Equipment Co.
Phone (701) 239-8755
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists