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

Parameter and Report selection

Status
Not open for further replies.

UHsoccer

Programmer
Apr 24, 2003
139
US
I need to select based on a parameter username (First-name Last-name. I use the Report selection as follows:
{?UserName} = {vwTime.FName} + " " + {vwTime.LName} That query takes 3-4 minutes

When I test using UserName1 = First-Name and UserName2 = Last-Name then query with
( {?UserName1} = {vwTime.LName} and {?UserName2} = {vwTime.FName} ) it takes 10 SECONDS!

How can I build the query so I do NOT have to have two parameters (one for first-name and oner for last-name)

Like to use something like:
( {?UserName1} = [first-part-of parameter] and {?UserName2} = [second-part-of-parameter] )
 
If the users enter the parameter {?UserName} as first name <space> last name, you could use this as your record selection formula:

{vwTime.FName} = trim(split({?UserName}, &quot; &quot;)[1]) and
{vwTime.LName} = trim(split({?UserName}, &quot; &quot;)[2])

If you want them to enter the parameter as last name <comma> first name, use this:

{vwTime.LName} = trim(split({?UserName}, &quot;,&quot;)[1]) and
{vwTime.FName} = trim(split({?UserName}, &quot;,&quot;)[2])

-dave
 
Exactly what the doctor ordered. I was trying to use left/right functions, this is simpler

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top