NetTalk Central

Author Topic: setting up filter  (Read 3892 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
setting up filter
« on: May 31, 2010, 04:17:25 PM »
Hi All,
Trying to set up a filter -  three conditions:
1. JPS:Sdate > today() - 30
AND
2a. Prv:ihid =' &p_web.GSV('_providerID')
OR
2b Prv:alt_ihid =' &p_web.GSV('_altproviderID')

Have it set up as :
'JPS:Sdate > today() - 30 and ( & Prv:ihid =' &p_web.GSV('_providerID') & 'OR  Prv:alt_ihid =' &p_web.GSV('_altproviderID') & ')'

Compiles OK but DOES NOT WORK!

Suggestions please!!!!!

Thanks,

Ron Jolda

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: setting up filter
« Reply #1 on: May 31, 2010, 06:49:24 PM »
try

'JPS:Sdate > ' & today() - 30 & ' and (Prv:ihid = ' & p_web.GSV('_providerID') & ' OR  Prv:alt_ihid = ' & p_web.GSV('_altproviderID') & ')'

As filters can be a bit tricky I sometimes find with more complicated ones I will set the filter as a variable and then before the filter code is called set the variable.

That way I can add a debug message and see what my filter looks like with actual values etc

HTH's

Kev

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: setting up filter
« Reply #2 on: June 01, 2010, 02:47:19 AM »
Thanks Kevin,
WIll try this and also will try setting up as variable!
ROn

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: setting up filter
« Reply #3 on: June 01, 2010, 11:52:38 AM »
Setting it as a variable was the way to go.  Was able to debug and get it going.
Many thanks for the tip.
Ron

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: setting up filter
« Reply #4 on: June 01, 2010, 05:31:19 PM »
I'm glad it helped. It's just a lot easier to read/edit in the source code as well. You probably already know but the other tip is to just break the filter into little bits and test one at a time.