A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

tables format percentages



 
 
Thread Tools Display Modes
  #1  
Old March 11th, 2005, 01:56 AM
shank
external usenet poster
 
Posts: n/a
Default tables format percentages

I'm trying to setup one field in my table to show percentages. I've selected
format=percentage and tried everything from deciaml to double to long
integer etc. When I enter the digits "75" the field will display 7500.00%.
How can I setup the field to show 75%? I gotta be missing something simple
here...

thanks


  #2  
Old March 11th, 2005, 03:03 AM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

Enter .75 if you want 75%.

--
Duane Hookom
MS Access MVP


"shank" wrote in message
...
I'm trying to setup one field in my table to show percentages. I've
selected format=percentage and tried everything from deciaml to double to
long integer etc. When I enter the digits "75" the field will display
7500.00%. How can I setup the field to show 75%? I gotta be missing
something simple here...

thanks




  #3  
Old March 11th, 2005, 02:15 PM
shank
external usenet poster
 
Posts: n/a
Default

I understand that, but I guess my thoughts were along entering a value like
"seventy-five percent" as opposed to "seventy-five hundredths of a percent"
to get my desired end results.
thanks


"Duane Hookom" wrote in message
...
Enter .75 if you want 75%.

--
Duane Hookom
MS Access MVP


"shank" wrote in message
...
I'm trying to setup one field in my table to show percentages. I've
selected format=percentage and tried everything from deciaml to double to
long integer etc. When I enter the digits "75" the field will display
7500.00%. How can I setup the field to show 75%? I gotta be missing
something simple here...

thanks






  #4  
Old March 11th, 2005, 03:21 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

If you want to allow users to enter 75 to represent .75 (75%) then you can
add some code to the After Update event of the text box like:
Private Sub txtPctComplete_AfterUpdate()
If Me.txtPctComplete 2 Then
Me.txtPctComplete = Me.txtPctComplete / 100
End If
End Sub
If the value entered is greater than 2, the value will be divided by 100.
You might want to check for nulls or change the 2 to 1.

--
Duane Hookom
MS Access MVP
--

"shank" wrote in message
...
I understand that, but I guess my thoughts were along entering a value like
"seventy-five percent" as opposed to "seventy-five hundredths of a
percent"
to get my desired end results.
thanks


"Duane Hookom" wrote in message
...
Enter .75 if you want 75%.

--
Duane Hookom
MS Access MVP


"shank" wrote in message
...
I'm trying to setup one field in my table to show percentages. I've
selected format=percentage and tried everything from deciaml to double
to long integer etc. When I enter the digits "75" the field will display
7500.00%. How can I setup the field to show 75%? I gotta be missing
something simple here...

thanks








  #5  
Old March 11th, 2005, 05:06 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

"shank" wrote in
:

When I enter the digits "75" the field will display 7500.00%.
How can I setup the field to show 75%? I gotta be missing something
simple here...



An alternative approach is to rethink the design a little bit. A value of
75% _is_ the same as 0.75; and that is how it is stored and typed. What
about storing the PercentagePoints as a number, and then accounting for
that in any maths that comes afterwards:


SELECT FullPrice * (100 - PercentDiscount)/100 AS NetPrice
FROM etc


which is only trivially harder than

SELECT FullPrice * (1 - DiscountFraction) AS NetPrice

which is presumably what you are doing at the moment.

If you want it to look nice, put a label control to the Right of the text
box control and put a single '%' character in it, just to remind users
that they have to put in a percentage amount.

Hope that helps


Tim F


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables used during development rpw New Users 6 July 1st, 2004 01:29 AM
Mutliple Tables lookup? Westley Database Design 4 June 15th, 2004 01:07 AM
Format All Tables Kevin Barmish Tables 3 June 11th, 2004 02:58 PM
Multiple Many-To-Many Tables Tom Database Design 7 May 15th, 2004 03:47 AM


All times are GMT +1. The time now is 03:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.