Converting Letters to Number value in Access Query

Posted on 2013-09-05
Medium Priority
Last Modified: 2013-09-05
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?


Question by:shogun5
  • 3
  • 2
LVL 61

Expert Comment

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

The ASCII values for your upper case letters start with 65.

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

Author Comment

ID: 39469122
How can I used this in a query. I keep getting an error message. See attachment.
LVL 61

Accepted Solution

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

 Asc([Bas Boy])
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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:

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?

Author Closing Comment

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

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

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.

Join & Write a Comment

If Skype for Business came with your office 2016 or office 365 installation, you may find that it's almost impossible to either disable or remove it. The application will often launch with each start of Windows, even when explicitly configured not t…
I tried to use the SharePoint app to Import a Spreadsheet and import an Excel sheet into a Team site made in SharePoint 2016. But that just resulted in getting an error message 'Unknown Error'...
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question