DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS Access and FileMaker Pro (http://www.daniweb.com/forums/forum128.html)
-   -   Calculated field in Access (http://www.daniweb.com/forums/thread197495.html)

mars964 Jun 14th, 2009 4:41 pm
Calculated field in Access
 
Hello,

This was supposed to be easy but I could not get it!
I need to create a calculated field in Access (preferably in a table or maybe a query) that calculates the BMI. I have fields for the weight in kgs and Height in cm. The formula is:
BMI=(Wt(in kg)/(Ht (in meters)^2)). However, as the height is stored in cm I need to convert it to meter. And also, I need the BMI with only 1 decimal place (for example: 23.6)
I came up with the expression:
=([Tbl1]![weight])/(([Tbl1]![Height]/100)^2)

Can anyone help!
Thank You.
Mona

hiền muội Jul 7th, 2009 1:04 am
Re: Calculated field in Access
 
Try code:
=FormatNumber(([Tbl1]![weight])/(([Tbl1]![Height]/100)^2) ,1)


All times are GMT -4. The time now is 8:47 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC