ALTER PROCEDURE [dbo].[selectDataByDDLValue](@ddlValue varchar(50))
AS
IF @ddlValue = 'Uname'
BEGIN
select distinct Fname,Lname from Client_registration_tbl
END
ELSE
BEGIN
IF @ddlValue = 'Delivery_Date'
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
ELSE
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date,b.Extend_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
END
Happy Coding!
:)