Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select only numbers

Status
Not open for further replies.

ChipF

Technical User
Nov 15, 2002
50
US
I want the selection formula to select the customer comment field only if it starts with a number. This is a way to identify certain codes throughout the day. Most comments are letters, but I only want numerals. How do I do this? Is there something I can put after (starts with)?
 
Try this:
1.) Create a SQL Expression to look at the First Character
%FIRST
{fn LEFT(CharAndNum.`CustCode`,1 )}

2.) Use this in your Record Selection formula{%FIRST} in "0" to "9"

HTH



Bob Suruncle
 
Or create a SQL Expression which contains:

//%IsItNumeric
isnumeric(substring(fieldname,1,1))

(I use substring here in case your database doesn't support Left, and depending upon your database you may have a different isnumeric function)

Now your record selection would just be:

{%IsItNumeric} = 1

Or you could just use a record seelction formula of isnumeric(left({table.field},1))

but it won't pass it to the database for processing, hence performance will suffer.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top