SET @X_Valid =(SELECT COUNT(*) FROM scheme_valid WHERE ( @From_Date between From_Date and To_Date or @To_Date between From_Date and To_Date or From_Date between @From_Date and @To_Date or To_Date between @From_Date and @To_Date ) AND Scheme_ID=@L_id)
SET @X_Valid =(SELECT COUNT(*) FROM scheme_valid WHERE ((From_Date >= @From_Date) or (@From_Date IS NULL) AND (To_Date <= @To_Date) or (@To_Date IS NULL)) AND Scheme_ID=@L_id)
NOT IsNull(To_date) AND (...)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)