Hi

I'm trying to create a report that shows details of books in a database and their authors.

I'm having trouble with my record selection formula. The user passes in one or more parameters to search on. The parameters relate to the author's surname, forenames and initials. The user can pass in exact details or wildcarded partial details. I want the report to show the books with one or more author that matches the criteria entered but also to show all other authors of the same book who do not match the criteria. Currently, only the authors that match are shown.

This application is being adapted from an Access database. The SQL for the Access report contains the following 'Where' clause (with 'W%' being passed in as an example parameter):

WHERE (((BookAuthor.BookID) In (SELECT [BookAuthor].BookID FROM Person
RIGHT JOIN [BookAuthor] ON Person.[PersonID] = [BookAuthor].PersonID
WHERE (((Person.Forenames) Like ('%') Or (Person.Forenames) Is Null)
AND ((Person.Initials) Like ('%') Or (Person.Initials) Is Null)
AND ((Person.Surname) Like ('W%'))))))


Currently in my record selection formula, I have:

{Person.PersonID} = {BookAuthor.PersonID}
and
{BookAuthor.BookID} = {reportview_BookAndPubl.BookID}
and
If {?SNameParam} <> "" Then {Person.Surname} like {?SNameParam}
or
if {?FNameParam} <> "" Then {Person.Forenames} like {?FNameParam}
or
if {?InitialsParam} <> "" Then {Person.Initials} like {?InitialsParam}

Can you suggest anything to make this formula work like the original sql?
Thanks.