Test a substring for "numeralcy"?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's a simple way to test the left two chars of a field to see if they are
numerals, or not?
 
What's a simple way to test the left two chars of a field to see if they are
numerals, or not?

Iif(IsNumeric(Left([fieldname], 2)), <yes it's numeric>, <no it's
not>)

John W. Vinson[MVP]
 
Hi Ricter

If a leading space can be considered as a zero (e.g. " 4abc"), then use:

IsNumeric( Left( [YourString], 2) )

If a leading space is not allowed, then use:

Left( [YourString], 2) like "##"
 

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

Back
Top