Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 phone and ssn format

Author  Topic 

hizakemi
Starting Member

33 Posts

Posted - 2007-01-12 : 13:40:05
Hellow!

1: How do I format (PHONE)9999999999 into 999-999-9999. See my ASP scripts below.
Thk

response.write "<td class='celldata' width='25%'>" & rst.fields("RepBestPhone") & "</td>" & vblf

2: How do I format (SSN)999999999 into 999-99-9999. See my ASP scripts below.
Thk

response.write "<td class='celldata' width='25%'>" & rst.fields("RepBestSSN") & "</td>" & vblf

Any help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-12 : 13:42:53
FORMAT(rst.Fields("RepBestPhone"), "###-###-####")


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

hizakemi
Starting Member

33 Posts

Posted - 2007-01-12 : 14:13:55
IT DOES NOT WORK

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FORMAT'

Thk

quote:
Originally posted by Peso

FORMAT(rst.Fields("RepBestPhone"), "###-###-####")


Peter Larsson
Helsingborg, Sweden

Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2007-01-12 : 14:52:37
(Moved this to the appropriate forum)

-Bill

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-01-12 : 14:53:26
FormatNumber



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-12 : 16:01:21
Thank you Mladen.
I couldn't figure out that OP was not even able enough to figure this out..


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -