SQL query to select dates between two dates

后端 未结 22 1674
囚心锁ツ
囚心锁ツ 2020-11-22 09:10

I have a start_date and end_date. I want to get the list of dates in between these two dates. Can anyone help me pointing the mistake in my query.<

22条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 09:42

    it's better write this way:

    CREATE PROCEDURE dbo.Get_Data_By_Dates
    (
        @EmployeeId INT = 1,
        @Start_Date DATE,
        @End_Date Date
    )
    AS
    Select * FROM Calculation  
        where EmployeeId=@EmployeeId AND Test_Date BETWEEN @Start_Date AND @End_Date
    RETURN
    

提交回复
热议问题