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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numeric Field - how to find "endswith" xxx3 3

Status
Not open for further replies.

loveyoursite

Technical User
Apr 14, 2005
100
US
CRV10. I have a numeric field (EMPLOYEE.NBR) that could contain up to 9 digits. I need to select only the employee numbers that end with either 3 or 8. Could someone possibly help me with the formula? Thanks!
 
Try the following in your record selection formula:

val(right(totext({employee.nbr},0,""),1)) in [3,8]

-LB
 
Try this

Code:
right(totext({table.field}),1) in ["3","8"]

-LW
 
Actually, if you can use a SQL expression, create the following SQL expression {%emplno}:

right({EMPLOYEE.NBR},1)

And then in your record selection formula use:

{%emplno} in ["3","8"]

This will pass to the SQL, making the report faster.

-LB
 
Hi,
Use the ToText function to change it to text, then the Right
function to test the last character..See the help file for details on using these.
Something like this for a selection criteria formula:
Code:
Right(ToText({employee.nbr},'#'),1) in ['3','8']

Something like that should do what you want..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top