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!

Record selection on alpha range 1

Status
Not open for further replies.

NJChris

Technical User
Jul 11, 2005
6
US
I am using CR 9.5 and am trying to allow the end users to retrieve customer invoices based on the customer's name. I am currently trying:
{Customer.Name} >= {?StartName} and
{Customer.Name} <= {?EndName}

The problem I have is that if {?StartName} = "A" and
{?EndName} = "A" no records are returned. Also If
{?StartName} = "A" and {?EndName} = "C" then all "A" names and "B" names are returned but no "C" names are. I have used this same logic for date ranges in the past with no problem but it seems in this case the "or equal" part of the formula is being ignored.

Any assistance is greatly appreciated.
 
I think you are expecting names to be returned based on the first letter, i.e., you are really assuming that the data that starts with these letters will be returned. However, if you select one letter for both start and end, your formula will limit the records to those with a name equal to that letter alone, because it is being directed to choose data based on one letter. In a sort single letters will always sort before two letters, etc.

What you might want to do is provide a prompt that tells the user to select an end letter that will be the first letter after the start letter NOT to be included in the data. To get "A", the user will need to enter a start of "A" and an end of "B".

Or, you could change your record selection formula to:

{table.string} >= {?startname} and
{table.string} <= {?endname}+'z'

-LB
 
Thanks lbass, your suggestion worked perfectly. Rather then confuse the end users I opted for your second suggestion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top