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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

round Fraction



 
 
Thread Tools Display Modes
  #1  
Old October 26th, 2008, 08:50 AM posted to microsoft.public.access
Ghost
external usenet poster
 
Posts: 181
Default round Fraction

Greeting,

I have the following fraction need to be rounded if they met cretin
conditions:
From 0.01 to 0.019 = 0
0.20 to 0.39 =0.25
0.40 to 0.60 =0.50

How to do that in form please??

  #2  
Old October 26th, 2008, 09:41 AM posted to microsoft.public.access
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default round Fraction

SomeName: IIf([TableName]![YourNumberField] Between 0.01 And
0.19,0,IIf([TableName]![YourNumberField] Between 0.2 And
0.39,0.25,IIf([TableName]![YourNumberField] Between 0.4 And 0.6,0.5)))


--
Wayne
Manchester, England.



"ghost" wrote:

Greeting,

I have the following fraction need to be rounded if they met cretin
conditions:
From 0.01 to 0.019 = 0
0.20 to 0.39 =0.25
0.40 to 0.60 =0.50

How to do that in form please??

  #3  
Old October 26th, 2008, 04:40 PM posted to microsoft.public.access
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default round Fraction

You can call the Switch function. This accepts a list of expressions and
returns a value associated with the first expression which is True, so the
ControlSource for a text box on a form would be:

=Switch([YourField] 0 And [YourField] 0.2,0,[YourField] = 0.2 And
[YourField] 0.4,0.25,[YourField] = 0.4 And [YourField] = 0.6,0.5)

where YourField is the name of a field or control containing the original
number. For values less than zero or greater than 0.6 Null would be returned.

Ken Sheridan
Stafford, England

"ghost" wrote:

Greeting,

I have the following fraction need to be rounded if they met cretin
conditions:
From 0.01 to 0.019 = 0
0.20 to 0.39 =0.25
0.40 to 0.60 =0.50

How to do that in form please??


 




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


All times are GMT +1. The time now is 11:17 PM.


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