NetTalk Central

Author Topic: How to use INSTRING in a filter?  (Read 4926 times)

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
How to use INSTRING in a filter?
« on: October 07, 2011, 08:17:00 AM »
Hello,

I want to use INSTRING in a filter.  I have a local variable being used for entering search data.  I want the text entered in that field to be searched for in a field in my browse.

Here's part of what I;ve been trying:

(Instring(upper(p_web.GSV(<39>LOC:Owner<39>)),upper(p_web.GSV(<39>PER:Owner<39>)),1,1) > 0

LOC:Owner is the search field.  PER:Owner is the field being searched.  I do not want to use a standard locator.  I want the user to be able to enter data and click a search button.

Perhaps INSTRING is not the best way.

Any suggestions appreciated,

Don

NetTalk 5.37
TPS
« Last Edit: October 07, 2011, 04:30:44 PM by DonRidley »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to use INSTRING as a filter?
« Reply #1 on: October 07, 2011, 01:40:22 PM »
I basically want to duplicate the effect of entering data in a locator field but with my own entry control and such...if possible.

Don
« Last Edit: October 08, 2011, 08:09:57 PM by DonRidley »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to use INSTRING in a filter?
« Reply #2 on: October 08, 2011, 08:11:04 PM »
Can INSTRING be used this way?
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: How to use INSTRING in a filter?
« Reply #3 on: October 09, 2011, 02:45:33 AM »
Try something like...

loc:FilterWas = 'Instring(<39>' & Clip(Loc:UserLogin) & '<39>,POMT:Approved,1,1) > 0'

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to use INSTRING in a filter?
« Reply #4 on: October 09, 2011, 04:52:40 AM »
Hey Kevin,

Yours didn't work but it did get me pointed int he right direction.

Here's what did work...

' Instring(<39>' & Clip(p_web.GSV('Loc:Owner')) & '<39>,PER:Owner,1,1) > 0'

THANK YOU!!!!!!

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: How to use INSTRING in a filter?
« Reply #5 on: October 09, 2011, 04:24:23 PM »
Well it works if the local variable is primed with the GSV but I thought you would work that out for yourself... BTW you don't need to clip GSV's as they are returned clipped.

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to use INSTRING in a filter?
« Reply #6 on: October 09, 2011, 04:37:40 PM »
Ah.. a GSV automatically clips.. didn't know that.

Thanks Kevin!!
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to use INSTRING in a filter?
« Reply #7 on: October 09, 2011, 11:18:56 PM »
all p_web methods that return a string, return a clipped string.

cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: How to use INSTRING in a filter?
« Reply #8 on: October 10, 2011, 02:21:38 AM »
Awesome!  Thanks guys!   I have been away from NetTalk for too long!

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11