Displaying an Access Percentage

  • Thread starter frontpagecustoms.com
  • Start date
F

frontpagecustoms.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?
 
S

Stefan B Rusynko

Use
percentvalue=FormatPercent(yourDBvalue,2)

--

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


|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?
|
 
F

frontpagecustoms.com

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

Thanks
 
S

Stefan B Rusynko

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/dbrwtipsandtricks.asp#percent
--

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


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

frontpagecustoms.com

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

frontpagecustoms.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=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td
bgcolor=&quot;#FFFF00&quot;&gt;&lt;font
color=&quot;#000000&quot;&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"-->
 
F

frontpagecustoms.com

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?
 
K

Kathleen Anderson [MVP - FrontPage]

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/
 
F

frontpagecustoms.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.
 
K

Kathleen Anderson [MVP - FrontPage]

frontpagecustoms.com said:
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/
 
F

frontpagecustoms.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?
 
K

Kathleen Anderson [MVP - FrontPage]

frontpagecustoms.com said:
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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top