ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

SQLNotes...what is it exactly?

<< < (72/235) > >>

PPLandry:
I think that if you
1- Add a column for NbCredit and fill it. Set column calc to Parent=sum(children)
2- In the CalcGPA add a parameter to now read Function CalcGPA(Grade,NbCredit). Set column calc to Parent=sum(children)
3- Add a column AVGGPA and set the equation to GPA / NbCredit

I think this should do it (but I haven't tested it).

superboyac:
I think that if you
1- Add a column for NbCredit and fill it. Set column calc to Parent=sum(children)
2- In the CalcGPA add a parameter to now read Function CalcGPA(Grade,NbCredit). Set column calc to Parent=sum(children)
3- Add a column AVGGPA and set the equation to GPA / NbCredit

I think this should do it (but I haven't tested it).
-PPLandry (January 08, 2008, 06:00 PM)
--- End quote ---
For the NbCredit field, isn't that the same as my Unit field?  I think it is.  By the way, I realize you're using the conventional naming methods with "Nb" for number and so on.  Should I be doing this also?

PPLandry:
yes NbCredit is the same as your Unit (I did not notice that field). Naming convention is your own decision. I tend to avoid spaces because one then need to wrap the field with in [  ]. Other than that, it is good to think locally and globally:
1- If the file is used for other purposes, make sure the name will not be confused to mean something else. Make the name just specific enough.
2- If the field could be used in other applications, make it's name generic enough. A generic Date field, along with a qualifying field (i.e.MusicLibrary) is sometimes preferable to MusicLibraryDate, especially if the database will be used for many uses, you probably don't want to end up with 10-20 date fields. The advanced filtering will allow you to get back only the dates specific to MusicLibrary

PPLandry:
I was trying to do it on my own... but ran into a problem  :huh:

Basically, CourseAVG had both an equation and a level calc. There was a conflict between the two.

I've made a modification to enable correct computation.

PPLandry:
This is what I got:
SQLNotes...what is it exactly?

CourseUnits hierarchy operations: Parent=sum(children)

CourseGPA equation: =CalcGPA(CourseGrade,CourseUnits)
CourseGPA hierarchy operations: Parent=sum(children)

CourseAVG equation: =CourseGPA/CourseUnits

And this user function:

--- Code: Visual Basic ---FUNCTION CalcGPA(Grade, Units)dim tSELECT case Gradecase "A": t=4.0case "A-": t=3.7case "B+": t=3.3case "B": t=3.0case "B-": t=2.7case "C+": t=2.3case "C": t=2.0case "C-": t=1.7case "D+": t=1.3case "D": t=1.0case "D-": t=0.7case "F": t=0.0end SELECTCalcGPA = t * Unitsif isnull(Grade) or grade="" then CalcGPA=nullEnd FUNCTION

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version