Results 1 to 4 of 4
  1. #1
    JoJoM is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Warren County, NJ
    Posts
    2

    Calculating GPA with a long integer field

    In student records, I need to store "credits attempted" versus "credits earned" in order to calculate GPA. This has usually worked but the school has a new credit points system in the medical/dental where the "credits attempted" are, for example, 4.70. (Most are 3, 4, or other whole numbers) I have a lookup table (course master) which stores credit hours as long integer. I have an update query that looks up credits attempted in the course master. The 4.70 keeps coming over to the student table as "5". I have tried changing number types and decimal places. It is not a space issue. any ideas?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The field type in student table must be Double type.

    What do you mean by 'keeps coming over' - coming from where? Where does 4.70 come from?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It is fine if the underlying fields used in your calculations (i.e. hours/credits) are stored as Long Integer, but not your calculated field. Long Integers do not allow for any decimal places.
    How/where is this calculation done?
    Are you trying to store this calculation in a field after calculating it?

  4. #4
    JoJoM is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Warren County, NJ
    Posts
    2
    1. The table Course_Master has a course ID and a field for "credit hours." Up to now, these have all been whole numbers.
    2. When a student takes a course, I create a detail row in a table called Student-Course. It stores student ID and Course ID. There is a field for "credits attempted," which is blank upon creation of the field.
    3. When final grades are entered, I run an update query that updates the credits attempted field in Student-Course based on the value stored in Course master. e
    UPDATE [Course Master] INNER JOIN [Student-Course] ON [Course Master].[Course Code] = [Student-Course].[Course Code] SET [Student-Course].[Credits Attempted] = [Course Master]![Credit Hours]
    WHERE ((([Student-Course].[Credits Attempted]) Is Null));

    4. The Course Master stores 4.70 credit hours for this one dental course, but when I run the update query, the record for the student who took that course now has a value of "5" in the Credits attempted field, not 4.70.

    I THINK i might have solved it by setting the data types as double, and 4 decimal places, in both tables.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. how much text in long integer field?
    By accessmatt in forum Database Design
    Replies: 10
    Last Post: 12-22-2014, 03:54 PM
  2. Replies: 7
    Last Post: 04-23-2013, 11:57 AM
  3. Using DCount with Long integer
    By Dominaz in forum Access
    Replies: 5
    Last Post: 12-06-2011, 05:22 AM
  4. Adding column as INTEGER makes it a long integer?
    By luckycharms in forum Programming
    Replies: 2
    Last Post: 10-20-2010, 02:47 PM
  5. Replies: 3
    Last Post: 04-12-2009, 05:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums