Hello All,

I am new to Alpha Five v10 and still getting my feet wet. I need some help translating an old SQL Server T-SQL sp to a select statement using the SQL Genie. The statement works fine with an MS Access front end or .Net but cannot seem to get the filters right in Alpha. Here is the T-SQL


@FirstName nvarchar(50)= null,
@LastName nvarchar(50)= null,
@Gender nvarchar(10)= null,

AS
SET NOCOUNT On
SELECT DISTINCT tblEmp.EmpID, [FirstName] + ' ' +[LastName] AS WholeName
FROM tblEmployee
LEFT JOIN tblExp ON tblEmp.EmpID = tblExp.EmpID
LEFT JOIN tblCar ON tblEmp.EmpID = tblCar.EmployeeID
WHERE (@FirstName IS NULL or FirstName Like '%'+@FirstName+'%')
and(@LastName IS NULL or LastName Like '%'+@LastName+'%')
and (@Gender IS NULL or Gender = @Gender)

What happens normally is that the sp returns an exact match based on the parameters. Example if "Joe" was the parameter for @FirstName the sp would return only those individuals that match the parameter. @FirstName = "Joe", @LastName = "Smith" would return only Joe Smith but Alpha returns Joe Jones, Cindy Smith, etc. Would love to bind grid directly to sp but based on what I've read that is not possible. Any help would be much appreciated. Thanks.