Home All Groups Group Topic Archive Search About

Query - pop-up menu for user data entry

Author
4 Feb 2006 9:15 PM
ROY A. DAY
Using the following syntax:
Select fname, lastn
From list
Where fname like 'jones'

I need the syntax that the user can enter a name to perform a query (the
user will enter a name on a pop-up menu before the query is performed).

Author
4 Feb 2006 10:19 PM
Tony Scott
Roy,

You didn't say in what context you would be using this, so the below-code
assumes you are using a Stored Procedure:

CREATE STORED PROCEDURE [dbo].[usp_FindName]

@LName varchar(100)=''

AS

IF @LName<>''
BEGIN
   Select fname, lastn
   From list
   Where fname like @LName
END

GO

Hope thi assists,

Tony




Show quoteHide quote
"ROY A. DAY" wrote:

> Using the following syntax:
> Select fname, lastn
> From list
> Where fname like 'jones'
>
> I need the syntax that the user can enter a name to perform a query (the
> user will enter a name on a pop-up menu before the query is performed).



Post Thread options