Weight loss calculations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • typhoo1
    New Member
    • Feb 2008
    • 2

    Weight loss calculations

    Hi All,

    I'm hoping someone is able to help me with the following:

    I am creating a database for a weightloss group. The database is relational and has one table containing client details. There is another table containing consultation details. As each client is having more than one consultation this seemed sensible. The two tables are linked by a client ref no. in a one-to-many relationhip. The 'consultation details' records contain the client ref no.; date; and weight measurement.

    I now want to create an expression that calculates the difference between the weight recorded in the first consultation and the weight recorded in the last consultation for a given client ref no.

    I have absolutely no idea how to do this and would be grateful for any assistance.
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by typhoo1
    Hi All,

    I'm hoping someone is able to help me with the following:

    I am creating a database for a weightloss group. The database is relational and has one table containing client details. There is another table containing consultation details. As each client is having more than one consultation this seemed sensible. The two tables are linked by a client ref no. in a one-to-many relationhip. The 'consultation details' records contain the client ref no.; date; and weight measurement.

    I now want to create an expression that calculates the difference between the weight recorded in the first consultation and the weight recorded in the last consultation for a given client ref no.

    I have absolutely no idea how to do this and would be grateful for any assistance.
    Welcome to the scripts typhoo1!

    See attached zipped mdb file done as a single query in SQL derived from two tables the query of which will open automatically when you open the database. This should give you an idea of at least one way of doing it. There are other ways of course such as using Aggegate functions in Access DCount, DSum, DMax, DMin, DFirst, DLast, DAvg, Dlookup etc Have a look at the those functions in help and how you can use them within your application.

    Regards

    Jim :)
    Attached Files

    Comment

    • typhoo1
      New Member
      • Feb 2008
      • 2

      #3
      Thank you so much. It works! couldn't of done it without your help.

      Originally posted by Jim Doherty
      Welcome to the scripts typhoo1!

      See attached zipped mdb file done as a single query in SQL derived from two tables the query of which will open automatically when you open the database. This should give you an idea of at least one way of doing it. There are other ways of course such as using Aggegate functions in Access DCount, DSum, DMax, DMin, DFirst, DLast, DAvg, Dlookup etc Have a look at the those functions in help and how you can use them within your application.

      Regards

      Jim :)

      Comment

      • Jim Doherty
        Recognized Expert Contributor
        • Aug 2007
        • 897

        #4
        Originally posted by typhoo1
        Thank you so much. It works! couldn't of done it without your help.
        You're welcome :)

        Jim

        Comment

        Working...