I have a stored procedure that receives a date value like this:
@AsOf date
In the query I am using this date to filter a datetime field. I need to convert the date passed in to a datetime field with the time portion set to 09:00:00 PM so I can add a filter in the WHERE clause like this:
(DateCreated < @TimeAsOfNinePM)
I know this is easy, but it's just escaping me at the moment. I'm using SQL Server 2008.