Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How To: Displaying Percents in SQL Table

Posted on 2007-07-22
Medium Priority
Last Modified: 2008-01-09
Hi All-

I am very new ot using SQL tables.  I have created a "form" using excel that people fill out.  Some of the cells calculate a percent.  The cells are set to "Percent" for the data type with 2 decimal places.  However, I can not figure out how to get SQL to recognize the percent.  I am using Access to manage/review the data that comes in from the forms people compelte.  Essentially, I nned to get SQL to see the value from an excel as a Percent and then display that value in Access.  

1) what data tpye should I set the SQL table column to be?
2) What should I have the excel data type be?
3) Do I need to do anything in Access?
4) ect...

Thank you for any advice!!
Question by:bclivell
  • 2
  • 2
LVL 42

Expert Comment

ID: 19545114
There is no such thing as a percent data type. Percent is a display format for a numeric datatype.  The number .15 will display as 15%.  The number .1599 will display as 15.99% if the display format is percent with 2 decimal places.

So, your SQL datatype can be any numeric datatype.   The main consideration is that the (SQL) storage datatype must have 2 more decimal places to the left of the decimal point than the (Excel) percent display format.

If you want the Excel format percent with 2 decimals then the SQL format should be numeric with 4 decimals.

Author Comment

ID: 19546705
dqmq- Thank you for gettign back.  I am looking in the SQL data type options/properties for numeric data types and i can not find the place to enter the number of desired decimals place.  Can you please tell me where I can adjust this setting?  thank you!
LVL 42

Accepted Solution

dqmq earned 1000 total points
ID: 19549488
In column properties the "Scale" property is the number of digits to the right of the decimal place.  BTW, in-reading my previous answer, I see dislexia crept in--I should have said " the storage datatype must have 2 more decimal places to the right..."

Author Comment

ID: 19595342
Thank you!

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question