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!

Selection Expert formula question 1

Status
Not open for further replies.

ynott

Technical User
Sep 26, 2000
49
US
I'm trying to figure out a formula to do the following:

Except for the date parameter, I have two fields that I use in the select expert for a particular report, Digits and Street Name. Now, what I need to do is select all odd numbers for a particular address range. For example, I'm trying to query a report on all businesses with odd numbers between 400-800 Main St. Currently, I put in every single odd address manually, but I have to update this list as new businesses open up and take additional numbers. Since I have numerous business complexes that I track, this is a pain.

So, is there a way to set up all odd numbers only between a range of 400-800? If so, how?
 
First you have to convert to a numeric using the val function:

{@StreetNum}:
Val ({Address})

Then your selection formula can be:

{@StreetNum} in 400 to 800 and
Remainder ({@StreetNum},2 ) = 1 Ken Hamady
 
What is the definition of an odd number? It leaves a remainder when divided by 2. So...
{Street Name} = 'Main St.' AND
{Digits} >= 400 AND
{Digits} <= 800 AND
Remainder({Digits},2) <> 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top