I have a begindatetime field and a shift field I am passing as a parameter to a report. If the shift =1, I want to return all records from the begindatetime up to midnight of that day.
I was trying to do a datepart function to remove the time portion of this and then add it back, but I can't seem to get it right.
As well I have another piece of logic that says if the shift =2 then I want to return all records from the begindatetime up until the next day at 8:00 AM. So in other words if the user passes in 4/18/2006 5:00 PM, I would want the range up to 4/19/2006 8:00 AM.
Is there a better way to do this?