I'm having a difficult time accomplishing what I thought would be very simple
....

I'm retriving a phone number field from a SQL server (nchar type) that has
only numbers (no parentheses or dashes) i.e. "1112223333"

In Access it is very simple to utilize the Format Funtion but I can't find
any coding that works in HTML to format the text.

I want to display ...
<%=FP_FieldVal(fp_rs,"PrimaryPhone")%>
as (111) 222-3333


Thanks

Re: Format Phone Number Text by Kathleen

Kathleen
Sun Jul 17 09:26:42 CDT 2005

In your SQL, you could do this:

FORMAT(PrimaryPhone,'(###) ###-####') as newPhone

newPhone will show up on your page.


--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/


"R Keck" <RKeck@discussions.microsoft.com> wrote in message
news:6AB6D2F5-C2AB-4CA2-A92C-77DE2346D012@microsoft.com...
> I'm having a difficult time accomplishing what I thought would be very
> simple
> ....
>
> I'm retriving a phone number field from a SQL server (nchar type) that has
> only numbers (no parentheses or dashes) i.e. "1112223333"
>
> In Access it is very simple to utilize the Format Funtion but I can't find
> any coding that works in HTML to format the text.
>
> I want to display ...
> <%=FP_FieldVal(fp_rs,"PrimaryPhone")%>
> as (111) 222-3333
>
>
> Thanks



Re: Format Phone Number Text by RKeck

RKeck
Sun Jul 17 16:14:03 CDT 2005

That function works fine, but I can not make it work in SQL server, either in
a view in the Server itself or in FP's SQL statement for the DB View.

From what i can gather, SQL does not recognize the FORMAT() function

"Kathleen Anderson [MVP - FrontPage]" wrote:

> In your SQL, you could do this:
>
> FORMAT(PrimaryPhone,'(###) ###-####') as newPhone
>
> newPhone will show up on your page.
>
>
> --
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web: http://www.spiderwebwoman.com/resources/
>
>
> "R Keck" <RKeck@discussions.microsoft.com> wrote in message
> news:6AB6D2F5-C2AB-4CA2-A92C-77DE2346D012@microsoft.com...
> > I'm having a difficult time accomplishing what I thought would be very
> > simple
> > ....
> >
> > I'm retriving a phone number field from a SQL server (nchar type) that has
> > only numbers (no parentheses or dashes) i.e. "1112223333"
> >
> > In Access it is very simple to utilize the Format Funtion but I can't find
> > any coding that works in HTML to format the text.
> >
> > I want to display ...
> > <%=FP_FieldVal(fp_rs,"PrimaryPhone")%>
> > as (111) 222-3333
> >
> >
> > Thanks
>
>
>

Re: Format Phone Number Text by Stefan

Stefan
Mon Jul 18 07:05:09 CDT 2005

You could resort to inline string parsing
<% IF objRS("phone")<>"" Then %> Phone: (<%=Left(objRS("phone"),3) & ") " & Mid(objRS("phone"),4,3) & "-" &
Right(objRS("phone1"),4)%><%End If%>

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"R Keck" <RKeck@discussions.microsoft.com> wrote in message news:0A5E3ABF-E4A5-4478-BDE2-EF9D365E65E9@microsoft.com...
| That function works fine, but I can not make it work in SQL server, either in
| a view in the Server itself or in FP's SQL statement for the DB View.
|
| From what i can gather, SQL does not recognize the FORMAT() function
|
| "Kathleen Anderson [MVP - FrontPage]" wrote:
|
| > In your SQL, you could do this:
| >
| > FORMAT(PrimaryPhone,'(###) ###-####') as newPhone
| >
| > newPhone will show up on your page.
| >
| >
| > --
| > ~ Kathleen Anderson
| > Microsoft MVP - FrontPage
| > Spider Web Woman Designs
| > web: http://www.spiderwebwoman.com/resources/
| >
| >
| > "R Keck" <RKeck@discussions.microsoft.com> wrote in message
| > news:6AB6D2F5-C2AB-4CA2-A92C-77DE2346D012@microsoft.com...
| > > I'm having a difficult time accomplishing what I thought would be very
| > > simple
| > > ....
| > >
| > > I'm retriving a phone number field from a SQL server (nchar type) that has
| > > only numbers (no parentheses or dashes) i.e. "1112223333"
| > >
| > > In Access it is very simple to utilize the Format Funtion but I can't find
| > > any coding that works in HTML to format the text.
| > >
| > > I want to display ...
| > > <%=FP_FieldVal(fp_rs,"PrimaryPhone")%>
| > > as (111) 222-3333
| > >
| > >
| > > Thanks
| >
| >
| >