Skip to main content



      Home
Home » Archived » BIRT » Report Parameter question
Report Parameter question [message #199959] Thu, 09 November 2006 07:01 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: Report Parameter question [message #200166 is a reply to message #199978] Fri, 10 November 2006 04:44 Go to previous message
Eclipse UserFriend
Thanks that worked great.

Shaun
Previous Topic:problem in chart
Next Topic:deploy problem
Goto Forum:
  


Current Time: Tue Jul 22 15:45:38 EDT 2025

Powered by FUDForum. Page generated in 0.04507 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top