Avatar of MrAgile
MrAgile
Flag for Australia

asked on 

Adding hours, mins, secs to a dateparameter in stored procedure

Hi There,

I was wanting to add hours,mins,secs to some data parameters that I have in my stored proc. Can someone recommend the best way to do this? The times wont change as I need the start to be at midnight and the finish to be at 11.59.

Thanks in advance, Sean


---param
 
convert(varchar(20),@Start,113)
 
convert(varchar(20),@End,113)
 
---actual output
@Start='2009-03-21 00:00:00:000'
@End='2009-03-27 00:00:00:000'
--desired output
 
@Start='2009-03-21 12:00:00 AM'
@End='2009-03-27 11:59:59 PM'

Open in new window

Microsoft SQL Server 2005Microsoft SQL ServerMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
MrAgile

8/22/2022 - Mon