Start disassembly of the phone number from the right.

i.e.
Last 4 digits
then 3
then those left would be country/area code

Conrad

-----Original Message-----
From: Janine Jakim [mailto:[EMAIL PROTECTED]] 
Sent: 03 October 2001 06:53
To: CF-Talk
Subject: RE: SQL quicky


Well I would need to do something similar to the second example. But how
would I do it if phone number is just one generic field- not 3 like
you've shown? I tried  '(' + left(TELEPHONE, 3) + ')' which gave me a
weird result adding a period to it (3.4)  
 RIGHT(TELEPHONE,4) gives a number that isn't even a listed in the
database....and I wasn't quite sure how to extract the middle portion...
ho hum....

-----Original Message-----
From: Billy Cravens [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 03, 2001 11:47 AM
To: CF-Talk
Subject: RE: SQL quicky


Totally depends on what you're doing (select, update, insert) and where
your data is coming from.

But something like:
SELECT * FROM AddressBook
WHERE PhoneNumber = '(#areacode#) #exchange#-#suffix#'


Or maybe


SELECT '(' + areacode + ') ' + exchange + '-' + suffix AS PhoneNumber

---
Billy Cravens
Web Development, EDS
[EMAIL PROTECTED]


-----Original Message-----
From: Janine Jakim [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 03, 2001 7:21 AM
To: CF-Talk
Subject: OT:SQL quicky


How do I format a phone number (###) ###-#### within my cf sql
statement? My backend is sql 2000. Thanks in advance.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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

Reply via email to