Calculated field in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nour469
    New Member
    • Oct 2008
    • 18

    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.
    Nour
    Last edited by Frinavale; Jun 16 '09, 04:23 PM. Reason: Moved from introductions to Access Answers.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by Nour469
    ... However, as the height is stored in cm I need to convert it to meter.
    1 centimeter = 0.01 meters

    Originally posted by Nour469
    ... And also, I need the BMI with only 1 decimal place (for example: 23.6)
    Have you considered formatting the field that represents the BMI such that it only has1 decimal place?
    Last edited by Frinavale; Jun 16 '09, 04:24 PM. Reason: Bumping post: Experts please elaborate

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by Nour469
      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.
      Nour
      As a Calculated Field in a Query:
      Code:
      BM1: Format(([Weight])/(([Height]/100)^2),"#,#,#,#.0")

      Comment

      • Nour469
        New Member
        • Oct 2008
        • 18

        #4
        Calculated Field in Access

        Originally posted by ADezii
        As a Calculated Field in a Query:
        Code:
        BM1: Format(([Weight])/(([Height]/100)^2),"#,#,#,#.0")
        THANKS A MILLION..... THIS WORKED LIKE MAGIC!

        I just have a query on why could not I post this question on the "MsAccess" forum?? however, I am grateful for your reply... I truly appreciate it.
        Nour

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by Nour469
          THANKS A MILLION..... THIS WORKED LIKE MAGIC!

          I just have a query on why could not I post this question on the "MsAccess" forum?? however, I am grateful for your reply... I truly appreciate it.
          Nour
          You are quite welcome, Nour469.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Originally posted by Nour469
            I just have a query on why could not I post this question on the "MsAccess" forum??
            When you select MS Access from the menu it will bring you to a "Topics" page. That page has 2 links on it: "Insights" and "Answers". If you follow the Insights link you'll find a number of articles that are Access related. If you follow the link to the Answers forum you'll find answers to Access questions (this where you are able to post your question). You cannot post your question in the Topics page and should not in the Insights (unless it's an article)...so in the future ask your Access questions in the Access->Answers forum.

            :)

            -Frinny

            Comment

            Working...