Hi all, I have one stored procedure which have startdate and enddate as parameter. If I execute the Stored Procedure with the startdate and enddate, it is taking time as 00:00:000 as default. But I want to take the default time as 00:00 for startdate and 23:59 for end date. Can anybody guide how to make this...advance thanks.
Checkout this DBjournal articlehttp://www.databasejournal.com/features/mssql/article.php/10894_2197931_1 HTH _________ Satya SKJ Moderator SQL-Server-Performance.Com
What I want is ...if I give the date without giving time for the paratmeters, then startdate should take the time 00:00 and enddate should take the time as 23:59
declare @startDatedatetime, @endDatedatetime select @startdate = getdate() select @startdate = dateadd(dd, 0, datediff(dd, 0, @startdate)) select @endDate = dateadd(ms, -2, dateadd(dd, 1, @startdate)) select @startdate, @endDate Bambola.