Re: Put a percentage symbol on the end of value

  • Follow


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
0
Reply Utf 2/29/2008 6:07:10 PM

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

"TL" wrote:

> 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
0
Reply Utf 2/29/2008 7:08:01 PM


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



"TL" <TL@discussions.microsoft.com> wrote in message 
news:945E9A1D-A72D-4878-B262-EB955ADBA630@microsoft.com...
> 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
>
> "TL" wrote:
>
>> 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 


0
Reply Conan 2/29/2008 7:25:24 PM

2 Replies
1312 Views

(page loaded in 0.161 seconds)

Similiar Articles:
















7/24/2012 7:56:59 AM


Reply: