Report Parameter question [message #199959] |
Thu, 09 November 2006 07:01  |
Eclipse User |
|
|
|
Hi
I have the following report needed. Users need to be able to enter a value
from a range of fields to find a user on the database, for instance,
username, lastname, email, firstname.
My mysql query looks like
select username, email, firstname, lastname
from users
where username = ? or firstname = ? or lastname = ? or email = ?
when i set the parameters up i allow blank values so that the user can
only input the information they have and not need all the fields.
When the report returns, it returns rows where the parametered field is
blank, as you would expect.
How can i construct my query/report to get round this? or is there no way?
Thanks
Shaun
|
|
|
Re: Report Parameter question [message #199978 is a reply to message #199959] |
Thu, 09 November 2006 09:00   |
Eclipse User |
|
|
|
Hello,
you need to assert that the value matched is not blank. If "blank" means
empty string, then your where clause may look like
where (username = ? and username != '') or (firstname = ? and firstname
!= '') or ...
Regards
Martin
> Hi
>
> I have the following report needed. Users need to be able to enter a
> value from a range of fields to find a user on the database, for
> instance, username, lastname, email, firstname.
>
> My mysql query looks like
> select username, email, firstname, lastname
> from users
> where username = ? or firstname = ? or lastname = ? or email = ?
>
> when i set the parameters up i allow blank values so that the user can
> only input the information they have and not need all the fields.
> When the report returns, it returns rows where the parametered field is
> blank, as you would expect.
> How can i construct my query/report to get round this? or is there no way?
>
> Thanks
> Shaun
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03124 seconds