Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Want to get data of 5 days by selected date, for this i wrote a stored procedure but its not working, Please help me

SQL
ALTER PROCEDURE dbo.UserDairy
    @pToDate    datetime
AS
    SELECT * FROM tbl_UserDetail
    WHERE UDate BETWEEN @pToDate AND DATEADD(day, -5, @pToDate)
        ORDER BY UserID DESC
    RETURN


here UDate is created date and @pToDate parameter
Posted
Comments
Gajendra Yadav 8-Dec-12 12:46pm    
Here UDate value how you are taking ?
Yasir Farooq 8-Dec-12 12:49pm    
getdate()

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900