Here I want to check that if a trip for a particular semester is arranged between from date to date in previous table records.
Table Schema:
trip_from_date
trip_end_date
trip_sem_id
trip_dress_code
Stored Procedure:
CREATE PROCEDURE [db].[pro_1] var duration,
@Trip_sem_id int,
@Trip_from_date date,
@Trip_to_date date
AS
BEGIN
SELECT *
FROM isrp_trip_master
WHERE trip_sem_id=@Trip_sem_id
AND duration BETWEEN trip_from_date=@Trip_from_date AND trip_to_date=@Trip_to_date
AND isnull(trip_is_delete,0)=0
END
I expect a table with all field which fulfills my condition