This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > March 2007 > Displaying an Access Percentage





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Displaying an Access Percentage
frontpagecustoms.com

2007-03-01, 3:15 am

I have an access database that figures a percentage of growth. In
access it displays properly (12.34%), however when it displays in the
results region it shows at .12345678...

How do I fix this to display as a standard percentage?

Stefan B Rusynko

2007-03-01, 6:15 am

Use
percentvalue=FormatPercent(yourDBvalue,2)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"frontpagecustoms.com" <mark@sdag.org> wrote in message news:1172725969.592953.107810@j27g2000cwj.googlegroups.com...
|I have an access database that figures a percentage of growth. In
| access it displays properly (12.34%), however when it displays in the
| results region it shows at .12345678...
|
| How do I fix this to display as a standard percentage?
|


frontpagecustoms.com

2007-03-01, 6:18 pm

OK I'm a little ignorant. Where do i place that code? In access
formatting or in frontpage somewhere?

Thanks

Stefan B Rusynko

2007-03-02, 6:15 am

If you are hand coding your ASP pages in your FP page displaying the variable
As
<% percentvalue=FormatPercent(yourDBvalue,2) %>
or just
<% =FormatPercent(yourDBvalue,2) %>
If using the DBR Wizards see
http://spiderwebwoman.com/resources...cks.asp#percent
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"frontpagecustoms.com" <mark@sdag.org> wrote in message news:1172787506.920946.76750@v33g2000cwv.googlegroups.com...
| OK I'm a little ignorant. Where do i place that code? In access
| formatting or in frontpage somewhere?
|
| Thanks
|


frontpagecustoms.com

2007-03-03, 3:15 am

I am using the DBR Wizard. However the solution you linked to refers
to SQL. Will that solution also work with access?


Kathleen Anderson [MVP - FrontPage]

2007-03-03, 3:15 am

Yes, it means in your SQL statement.

--

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


"frontpagecustoms.com" <mark@sdag.org> wrote in message
news:1172888889.557389.228300@z35g2000cwz.googlegroups.com...
>I am using the DBR Wizard. However the solution you linked to refers
> to SQL. Will that solution also work with access?
>
>



frontpagecustoms.com

2007-03-03, 3:15 am

Is that in the DBR Wizard or an actual place in the code?

frontpagecustoms.com

2007-03-03, 3:15 am

Here is the code from the DBR Wizard containing the field that is the
percent "Total1YrPctInc"

<!--webbot bot="DatabaseRegionStart" s-columnnames="Company,Ch Acct
#,AMATT,YTDbgmc,05TotalBGMC,04TotalBGMC,03TotalBGMC,YTDstl,2005STL,
2004STL,
2003STL,TotalGiving,TotalGivingPrevYear,PerCapita,PerCapitaBGMC,PerCapitaSTL,PostalAddress,City,State,Zip,BusinessPhone,Section,BGMC1YrGrowth,STL1YrGrowth,Total1YrGrowth,BGMC1YrPct,STL1YrPct,Total1YrPctInc"
s-
columntypes="202,202,5,6,6,6,6,6,6,6,6,6,6,5,5,5,202,202,202,202,202,202,6,6,6,5,5,5"
s-dataconnection="ChurchSearch" b-tableformat="FALSE" b-
menuformat="FALSE" s-menuchoice="Company" s-menuvalue="Company" b-
tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-
listlabels="FALSE" b-listseparator="FALSE" i-listformat="1" b-
makeform="FALSE" s-recordsource="studentMissionsGiving06" s-
displaycolumns="Company,Total1YrPctInc,STL1YrPct,BGMC1YrPct,TotalGiving,TotalGivingPrevYear"
s-criteria s-order="[Total1YrPctInc] -" s-sql="SELECT * FROM
studentMissionsGiving06 ORDER BY Total1YrPctInc DESC" b-
procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-
norecordsfound="No records returned." i-maxrecords="5" i-groupsize="0"
botid="1" u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/
fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="BODY"
preview="&lt;table border=0 width="100%"&gt;&lt;tr&gt;&lt;td
bgcolor="#FFFF00"&gt;&lt;font
color="#000000"&gt;This is the start of a Database Results
region. The page must be fetched from a web server with a web browser
to display correctly; the current web is stored on your local disk or
network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" b-
UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-
DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" b-
ReplaceDatabaseRegion="FALSE" startspan --><!--#include file="../
_fpclass/fpdblib.inc"-->

frontpagecustoms.com

2007-03-03, 3:15 am

I'm still learning here... I'm assuming this is the SQL statement.
Where do I place the formatting code. And which parts need to be
customized for my site?


Kathleen Anderson [MVP - FrontPage]

2007-03-03, 6:15 pm

Try pasting this into the Custom Query window in the DBRW:

SELECT Company,Format(Total1YrPctInc,'##0.00##%') as
newTotal1YrPctInc,STL1YrPct,BGMC1YrPct,TotalGiving,TotalGivingPrevYear FROM
studentMissionsGiving06 ORDER BY newTotal1YrPctInc DESC


--

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


"frontpagecustoms.com" <mark@sdag.org> wrote in message
news:1172895250.881269.186710@v33g2000cwv.googlegroups.com...
> Here is the code from the DBR Wizard containing the field that is the
> percent "Total1YrPctInc"
>
> <!--webbot bot="DatabaseRegionStart" s-columnnames="Company,Ch Acct
> #,AMATT,YTDbgmc,05TotalBGMC,04TotalBGMC,03TotalBGMC,YTDstl,2005STL,
> 2004STL,
> 2003STL,TotalGiving,TotalGivingPrevYear,PerCapita,PerCapitaBGMC,PerCapitaSTL,PostalAddress,City,State,Zip,BusinessPhone,Section,BGMC1YrGrowth,STL1YrGrowth,Total1YrGrowth,BGMC1YrPct,STL1YrPct,Total1YrPctInc"
> s-
> columntypes="202,202,5,6,6,6,6,6,6,6,6,6,6,5,5,5,202,202,202,202,202,202,6,6,6,5,5,5"
> s-dataconnection="ChurchSearch" b-tableformat="FALSE" b-
> menuformat="FALSE" s-menuchoice="Company" s-menuvalue="Company" b-
> tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-
> listlabels="FALSE" b-listseparator="FALSE" i-listformat="1" b-
> makeform="FALSE" s-recordsource="studentMissionsGiving06" s-
> displaycolumns="Company,Total1YrPctInc,STL1YrPct,BGMC1YrPct,TotalGiving,TotalGivingPrevYear"
> s-criteria s-order="[Total1YrPctInc] -" s-sql="SELECT * FROM
> studentMissionsGiving06 ORDER BY Total1YrPctInc DESC" b-
> procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-
> norecordsfound="No records returned." i-maxrecords="5" i-groupsize="0"
> botid="1" u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/
> fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="BODY"
> preview="&lt;table border=0 width="100%"&gt;&lt;tr&gt;&lt;td
> bgcolor="#FFFF00"&gt;&lt;font
> color="#000000"&gt;This is the start of a Database Results
> region. The page must be fetched from a web server with a web browser
> to display correctly; the current web is stored on your local disk or
> network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" b-
> UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-
> DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" b-
> ReplaceDatabaseRegion="FALSE" startspan --><!--#include file="../
> _fpclass/fpdblib.inc"-->
>



frontpagecustoms.com

2007-03-03, 6:15 pm

I appreciate your time and have been working to implement the code you
sent me. However after putting that code into the Custom Query windos
in the DBRW I received the following error:

Database Results Wizard Error
Description: No value given for one or more required parameters.
Number: -2147217904 (0x80040E10)
Source: Microsoft JET Database Engine

I'm curious if I'm missing something or if I put it in the wrong place.

Kathleen Anderson [MVP - FrontPage]

2007-03-05, 6:16 pm

"frontpagecustoms.com" <mark@sdag.org> wrote in message
news:1172946591.674606.244190@8g2000cwh.googlegroups.com...
>I appreciate your time and have been working to implement the code you
> sent me. However after putting that code into the Custom Query windos
> in the DBRW I received the following error:
>
> Database Results Wizard Error
> Description: No value given for one or more required parameters.
> Number: -2147217904 (0x80040E10)
> Source: Microsoft JET Database Engine
>
> I'm curious if I'm missing something or if I put it in the wrong place.


First, please include the full text of the post you are replying to - it
makes it easier to follow the thread.

SELECT Company,Format(Total1YrPctInc,'##0.00##%') as
newTotal1YrPctInc,STL1YrPct,BGMC1YrPct,TotalGiving,TotalGivingPrevYear FROM
studentMissionsGiving06 ORDER BY Total1YrPctInc DESC


--

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



frontpagecustoms.com

2007-03-06, 6:16 pm

On Mar 5, 1:27 pm, "Kathleen Anderson [MVP - FrontPage]"
<spiderwebwo...@mvps.org> wrote:
> "frontpagecustoms.com" <m...@sdag.org> wrote in message
>
> news:1172946591.674606.244190@8g2000cwh.googlegroups.com...
>
>
>
>
> First, please include the full text of the post you are replying to - it
> makes it easier to follow the thread.
>
> SELECT Company,Format(Total1YrPctInc,'##0.00##%') as
> newTotal1YrPctInc,STL1YrPct,BGMC1YrPct,TotalGiving,TotalGivingPrevYear FROM
> studentMissionsGiving06 ORDER BY Total1YrPctInc DESC
>
> --
>
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web:http://www.spiderwebwoman.com/resources/


Thanks! It works. I appreciate your time an patience as you helped
me out.

Do you know if I have to do a custom query every time I want to
format? Can I enter the formatting code into the Database Results
Region Wizard in the SQL statement?


Kathleen Anderson [MVP - FrontPage]

2007-03-06, 6:16 pm

"frontpagecustoms.com" <mark@sdag.org> wrote in message
news:1173200051.568977.160490@j27g2000cwj.googlegroups.com...
> On Mar 5, 1:27 pm, "Kathleen Anderson [MVP - FrontPage]"
> <spiderwebwo...@mvps.org> wrote:
>
> Thanks! It works. I appreciate your time an patience as you helped
> me out.
>
> Do you know if I have to do a custom query every time I want to
> format? Can I enter the formatting code into the Database Results
> Region Wizard in the SQL statement?
>


If you are creating a new field as a result of the FORMAT, you should do it
in the Custom Query window that is available to you while you are running
the wizard.


--

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






frontpagecustoms.com

2007-03-06, 6:16 pm

On Mar 6, 1:29 pm, "Kathleen Anderson [MVP - FrontPage]"
<spiderwebwo...@mvps.org> wrote:
> "frontpagecustoms.com" <m...@sdag.org> wrote in message
>
> news:1173200051.568977.160490@j27g2000cwj.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> If you are creating a new field as a result of the FORMAT, you should do it
> in the Custom Query window that is available to you while you are running
> the wizard.
>
> --
>
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web:http://www.spiderwebwoman.com/resources/


Thanks.

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews