Steve1445
|
| Posted: 09/02/2005, 11:51 AM |
|
Created a search and search results grid attached to SQL tables. Works fine with the search results grid data source as Table and the name of the Data source, Organization (the SQL table).
I need to filter out all inactive and non-members. (STATUSSTT=Active) and (ISMEMBERFLG=Y) If I switch the Data Source Type to SQL and then write a SQL statement in the Data Source, the query succeeds but I can no longer search, the list is now static.
I tried the other way around, setting the SQL statement in the search to pass those results over to the Search Results Grid but that does not work either.
I would appreciate someone with some experience with filtering a search result passing along a few pointers. Thanks.
|
|
|
 |
DonB
|
| Posted: 09/02/2005, 1:47 PM |
|
With the SQL your search probably fails because you don't have parameters
declared whose names match the search criteria.
Let's say the search form has two controls, one named 's1' and the other
s2'. Add two parameters with the samee variable names/parameter source and
with their parameter source type set to "URL". Then edit the SQL to include
them, so it looks like this:
SELECT fields from yourtable
where STATUSSTT = 'ACTIVE'
AND ISMEMBERFLAG='Y'
AND searchfield1 = {s1}
AND searchfield2={s2}
(I chose my example parameter names to better illustrate the SQL usage, not
because they have to have those names)
Now your search form will construct a URL something like http://www.example.com?s1=1&s2=0 and the filter
It might be that you aren't quoting the ACTIVE and Y criteria in the query,
but I assume that was just a typo.
--
DonB
http://www.gotodon.com/ccbth
"Steve1445" <Steve1445@forum.codecharge> wrote in message
news:643189f453d901@news.codecharge.com...
> Created a search and search results grid attached to SQL tables. Works
fine with
> the search results grid data source as Table and the name of the Data
source,
> Organization (the SQL table).
>
> I need to filter out all inactive and non-members. (STATUSSTT=Active) and
> (ISMEMBERFLG=Y) If I switch the Data Source Type to SQL and then write a
SQL
> statement in the Data Source, the query succeeds but I can no longer
search,
> the list is now static.
>
> I tried the other way around, setting the SQL statement in the search to
pass
> those results over to the Search Results Grid but that does not work
either.
>
> I would appreciate someone with some experience with filtering a search
result
> passing along a few pointers. Thanks.
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Steve1445
|
| Posted: 09/06/2005, 8:56 AM |
|
Thank you.
|
|
|
 |
|