Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing minutes to fraction

Status
Not open for further replies.

Haroust

Technical User
Jun 15, 2003
4
US
I am writing an time card program

I have a field named [min] , when I run my report
I created a field named [Minfraction]. I need to assign
a value to this field depending of the value of [min].
Example:
[min] = 0 to 7 field [minfraction] must be 0
[min] = 8 to 22 field [minfraction] must be 0.25
[min] = 23 to 37 field [minfraction] must be 0.50
[min] = 38 to 52 field [minfraction] must be 0.75

if somebody could help me I would very much appreciate

Thank you
 
The following can be used as the Control Source in the report for the MinFraction control:

=Switch(Me![Min] < 8, 0, Me![Min] < 23, .25, Me![Min] < 38, .5, Me![Min] < 53, .75, True, 1 )

I wasn't sure what you wanted to do with minutes between 53 and 60 so I just returned a whole number 1. You can remove that if you wish just make sure you remove the preceeding comma also.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Thank you very much &quot;Bagdad Bob&quot; it works .
 
I am glad to have helped you with your project.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top