Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Re: Put a percentage symbol on the end of value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TL - 29 Feb 2008 18:07 GMT
Hello,

Problem:
I was able to get my percentage value using a SQL statement where it rounded
up the number using zero "Decimal Places" and "Format" is "Fixed."  When I
take the * 100 off and allow the query to do the math and make the value a
percentage it does not give me the output as a whole number. So, I multipled
it by 100 and now I want to just add a leading "%" sign. How can I add a "%"
sign to the end of a value.

I think I will need to change my query an update query instead of using a
Select query. Please assist with the simpliest solution.

Here is my SQL Statement:
SELECT qryTotalCountOfALLStudents.SumOfCountOfDegree_Program,
qryTop10ByInstitutions.[CountOfInstitution_ Name],
Format(qryTop10ByInstitutions.[CountOfInstitution_
Name]/qryTotalCountOfALLStudents.[SumOfCountOfDegree_Program])*100 AS Percnt
FROM qryTotalCountOfALLStudents, qryTop10ByInstitutions;

Thanks for your help.
TL
TL - 29 Feb 2008 19:08 GMT
Okay, I figured it out. You should not perform work arounds when you can not
make things work. There is a reason for everything and a reason why I was not
getting my results before in my problem stated below.

Solution:

I used the following SQL statement below then in Design View in the Percnt
column I highlighted and selected Properties and set Format to Fixed and
Decimal Place to "0." Now, I have my desired output. You will notice below
that instead of multiplying by 100, I just multipled by 1.

SELECT qryTop10ByInstitutions.[Institution_ Name],
qryTotalCountOfALLStudents.SumOfCountOfDegree_Program,
qryTop10ByInstitutions.[CountOfInstitution_ Name],
Format(qryTop10ByInstitutions.[CountOfInstitution_
Name]/qryTotalCountOfALLStudents.SumOfCountOfDegree_Program)*1 AS Percnt
FROM qryTotalCountOfALLStudents, qryTop10ByInstitutions;

Now my '%" sign shows up on all my values and I am happy again!
TL

> Hello,
>
[quoted text clipped - 18 lines]
> Thanks for your help.
> TL
Conan Kelly - 29 Feb 2008 19:25 GMT
TL,

What is the point of multiplying by 1?  There should be no need for it.

Also, keep in mind that by formatting like you did (IMO is the correct way
to do it), your query is DISPLAYING no decimal places, but what is showing
is not the value.  For example, lets say we are working with a number of
0.123456789.  With your method, 12% will show, but the actual value will
still be 12.3456789 %.  Are you going to need to use this percentage in a
calculation?  If so, 12.3456789 % will be used and not 12%.  Will that be
correct for the calculation?  If you need to use 12% then you should use a
rounding function on your data.

HTH,

Conan

> Okay, I figured it out. You should not perform work arounds when you can
> not
[quoted text clipped - 47 lines]
>> Thanks for your help.
>> TL
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.