Hey guys i have a quick question. I need help with a statment i am trying to get the avg of students gpa but my grades are in letter form. How do i go about changing the letter grade to number (ie. A = 4) and getting the avg gpa?

Thanks

You could map the character values to a reference table which contains characters and their numerical equivalent, query a join of both grade and reference table and select the average number value from the reference table.
Or you could code a function which returns a numerical value for each character and average the function results.
Or you could use an inline function like in

select student, avg(-1 * (ord(grade)-69)) group by student;

(assuming A=4, B=3, C=2 etc.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.