access caluclated field query

  • Thread starter Thread starter airnuminz
  • Start date Start date
A

airnuminz

Hi,

I am entering height, weights and age into a database and I want to
create a query which enables Access to automatically caluclate BMI
(two kinds depending upon the age of the kid)

Any suggestions on how to do this?

Thanks!
E
 
Hi,

I am entering height, weights and age into a database and I want to
create a query which enables Access to automatically caluclate BMI
(two kinds depending upon the age of the kid)

Any suggestions on how to do this?

Thanks!
E

BMI - and for that matter age - should NOT be stored in ANY table; they're
derived data which can and should be calculated. Rather than storing the age,
store the birthdate; create a Query based on the table and in a vacant Field
cell type

BMI: [Weight] /([Height]*[Height])

assuming weight in kg and height in meters. If you have a different
calculation, use it! Similarly, use an expression to calculate the age:

Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd", 1, 0)


John W. Vinson [MVP]
 
I am entering height, weights and age into a database and I want to
create a query which enables Access to automatically caluclate BMI
(two kinds depending upon the age of the kid)
Any suggestions on how to do this?
Thanks!
E

BMI - and for that matter age - should NOT be stored in ANY table; they're
derived data which can and should be calculated. Rather than storing the age,
store the birthdate; create a Query based on the table and in a vacant Field
cell type

BMI: [Weight] /([Height]*[Height])

assuming weight in kg and height in meters. If you have a different
calculation, use it! Similarly, use an expression to calculate the age:

Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd", 1, 0)

John W. Vinson [MVP]

THANKS!
 
Back
Top