Page 1 of 1

//KEYFIELD operation

PostPosted: Wed Nov 11, 2015 10:14 am
by neil.interactit
Hey guys,

I have the following ...
Code: Select all
Pass_IssuedBy Design
//TYPE = STRING
//CAPTION = Issued By
//SEARCH = YES
//SELECT = SELECT FullName,StaffID FROM (SELECT FName+' '+SName AS FullName, s.StaffID FROM HR_Staff s UNION SELECT '[Anyone]','[ANYONE]') tbl
//ORDER = ORDER BY FullName
//KEYFIELD = StaffID
//DEFAULT = SELECT '[Anyone]' FullName,'[ANYONE]' StaffID
"zzzzzzz "
Pass_IssuedBy Operating
'Admin '

The SQL result is (Admin,ZZZZZZZZZZ0000000000) and KEYFIELD = StaffID, yet the operating value is FullName.

If I swap the parameter order in the query then StaffID is operating, however it also displays on the filter page. I am trying to display "Admin" on the filter page, then filter on the StaffID.

Am I driving KEYFIELD incorrectly?

Cheers,
Neil.

Re: //KEYFIELD operation  Topic is solved

PostPosted: Mon Nov 23, 2015 4:44 pm
by Scott.Pearce
Am I driving KEYFIELD incorrectly?


Yes. KEYFIELD is used as the filter AND will be the value shown on the parameters page.

Instead of going with the UNION-ed "Anyone" approach, what if you provided a "From" Username and "To" Username? This would allow ranges of users, a specific user (From and To set to the same value), as well as "Anyone" (the default for From would be TOP 1 Username ORDER-ed by Username DESC, and the default for To would be TOP 1 Username ORDER-ed by Username ASC).