Hi
I have given only date parameters . All other null , but it is not going in If condition
-- =============================================
Alter PROCEDURE [dbo].[Ind_sp_CabProfitability]
@frDate date,
@toDate date,
@VCode nvarchar(15) = null,
@VName nvarchar(100) = null,
@CCode nvarchar(15) = null,
@CName nvarchar(100) = null,
@CGroup nvarchar(15) = null
as
begin
If @VCode is Null And @VName is Null And @CCode is null And @CName is null And @CGroup is null
Begin
SELECT
T1.U_VendCode as "Vendor Code",T1.U_CabNo,T1.U_VendName as "Vendor Name",
T1.U_CustCode as "Cust Code",T1.U_CustName as "Cust Name",T1.U_ItemCode,Max(T1.U_ItemName)
where T0.U_DATE BETWEEN @frDate and @toDate
End
End