CALCULATE PERCENT FOR A VALUE ENTERED IN A FORM OF A STRING

  • Thread starter Thread starter nn
  • Start date Start date
N

nn

I have created a field chemistry with type as text. the data entered for 150
marks which i want to convert to percentage. Help me in converting the same.
The formayt i tired was =val(che)*150/100 which gives a wrong conversion in
few places
 
Wrong conversion? Can you give a specific example of what you are converting
(the value in CHE), what you get, and what you want to get?

I might guess that Val is returning zero when you expect it to return something.

Val("o1") (that is letter o followed by number 1 returns zero. So if you are
getting zero as result, check what is actually in the field Che.

Val("123o45") will return 123. IF you want to check all the records at once,
you can use a query like the following to find those values that may not be
properly converted.

SELECT CHE
FROM SomeTable
WHERE IsNumber(Che) = False

In the query grid
Field: CheckChe: IsNumber([Che])
Criteria: False



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Format a Percent 4
Format a percent 7
Formatting a percent field 1
Format a percent field 1
Assigning values to text for calculation 0
percent / 100 1
Userform Calculation 4
Percentage Calculation 2

Back
Top