Returning Value of "score" if field is numeric

Jarad

Registered User.
Local time
Today, 15:21
Joined
Jul 3, 2007
Messages
19
I am pulling some information, and I am needing a report to show the value "score" if the field is numeric, but if it is not numeric, retain it's original value. for instance if the field is 1234 it needs to show on the report as "score" but if it is MSP it needs to say MSP.

Any help would be greatly appreciated.
 
Look at function IsNumeric as a way to test whether a string is numeric.

You realize, of course, that if the data type of the basic field is numeric, you will never see MSP 'cause strings don't go there. And if it is text, you will see the text representation of 1234, but to get the numeric value you need to also evaluate it using Val(). IsNumeric would only allow you to test whether Val() would work. Perhaps an IIF based on an IsNumeric, where if you get True then you use Val() and if not, you use the raw field?

Look up Access Help on IIF, Val(), and IsNumeric() to get your answers.
 

Users who are viewing this thread

Back
Top Bottom