2 Replies Latest reply on Jan 2, 2014 5:36 AM by gdurniak

    Newbie help with messy database

    robertstaflin

      I'm trying to make a grading database for one of Swedens iaido schools. I've made four tables:

       

      person (a person)

      handelse (an occurence, i.e. a person graded from one grade to another at a grading)

      gradering (a grading)

      grader (the differing grades)

       

      In a layout called Person, I want to show the latest grading from different categories, so for "normal" grades in the "grader" table I want the latest grading below id 18. Hence I use the following formula:

       

      If ( Max(Tillgrad::id) < 18 ; Max(Tillgrad::id) ; GetValue ( Tillgrad::id;1))

       

      ...where Tillgrad is a "copy" of the grader table.

       

      The problem is that it seems that I always get the value from Frangrad (another copy of the grader table). Please take a look at the attached pdf file... *Sob*

       

      I've also tried working with a portal to get the latest grading information, with much the same result - I get the value from the "Frangrad" (the grade from which the person graded to something else).

       

      Should I just start over, and use separate tables for the different grade categories?

       

      Thanks for any input.

        • 1. Re: Newbie help with messy database
          robertstaflin

          I might have sorted it out by changing the calculation to

           

               If ( Max(Tillgrad::id) < 18 ; Max(Tillgrad::id))

           

          ...and for the judgegrades...

           

               If(Max(Tilldomargrad::id)>17  &  (Tilldomargrad::id)<22;Max(Tilldomargrad::id))

           

          ...a.s.o.

           

          • 2. Re: Newbie help with messy database
            gdurniak

            since Tillgrad is related by Tillgrad -> ID,  Max(Tillgrad::id) doesn't seem to make sense

             

            you CAN put all the categories in one table, if the foreign keys are properly calculated, and stored (  e.g.  if ID < 18, 1, 0   then display all the 1's )

             

            I hope you found a solution

             

            greg

             

             

            > In a layout called Person, I want to show the latest grading from different categories, so for "normal" grades in the "grader" table I want the latest grading below id 18. Hence I use the following formula:

             

                 If ( Max(Tillgrad::id) < 18 ; Max(Tillgrad::id) ; GetValue ( Tillgrad::id;1))