SQL Server Stored Procedure default datetime parameter to today minus 30 days
Posted on 2007-11-14
I want to create a stored procedure in SQL server 2000 with a parameter that will default to today's date minue 30 days. I would also like to ability to over ride the default value in the stored procedure call if I need to.This is what I have. it is giving me an error.
CREATE PROCEDURE OH_Head
@start_date datetime = dateadd(day,-30,getdate())