Solved

# Converting Letters to Number value in Access Query

Posted on 2013-09-05
Medium Priority
1,016 Views
Dear Experts,

I am creating a chart based off of query values. One column is of letters, i.e. A,B,C,D, etc.

The problem I am running into is trying to graph those values. If a student receive a 'B' I'd like the column chart to reflect that on the y axis. So y axis would have from the bottom A to G for example. The x axis has student name. I can do this if the some how the LETTERS were numbers then I could represent numeric value on the y axis (of course not sure how I could create the  ALPHA labels on the y-axis.
Does anyone have any experience with this?

Thanks!

Mike
0
Question by:shogun5
• 3
• 2

LVL 61

Expert Comment

ID: 39469105
You can use the ASCII values of the letters.

You can get the ascii value like this:

Msgbox ASC("A")

If you want to have numeric representations of your letters, starting from 1, you can do this:

x = ASC("A")  - 64

Or using a string variable for your letter:

x = ASC(strLetter)  - 64
0

Author Comment

ID: 39469122
How can I used this in a query. I keep getting an error message. See attachment.
screenshot.png
0

LVL 61

Accepted Solution

mbizup earned 1800 total points
ID: 39469130
Looks like you are missing a bracket.

Asc([Bas Boy])
0

LVL 29

Assisted Solution

IrogSinta earned 200 total points
ID: 39469150
To have the letters A, B, C, D show up on the Y scale of a chart isn't that easy if you want it to be automated.  In a vertical bar chart, the Y-axis needs to be numerical in order to know where the end points are for each member of the data set, in this case, your students.

If you have a another field showing their WeightedScore aside from the LetterGrade field, you can use the new field for the Y-axis and come up with something like this:
0

Author Comment

ID: 39469152
Wow! Thanks. Yep missed that one. Do you know how I would display 65 (B) as 'B' on the y axis of a chart?
screenshot.png
0

Author Closing Comment

ID: 39469223
Thanks! I am going to post another question in regards to the y-axis conversion 'challenge'
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.