After tinkering around a bit, (searching yielded no results) I came up with this to round the time to the current half hour:
DateAdd(mi,DateDiff(mi,0,DateAdd(mi,-(DatePart(mi, GetDate())), GetDate())),0)
Returns 04/04/2005 10:00:00.000 at 10:25 am this morning for example.
As far as I can tell, this works, but in the quest for cleanness, I was wondering if 1) I had any redundant parts in there and 2) if there's an easier way to do this?
DateAdd(mi,DateDiff(mi,0,DateAdd(mi,-(DatePart(mi, GetDate())), GetDate())),0)
Returns 04/04/2005 10:00:00.000 at 10:25 am this morning for example.
As far as I can tell, this works, but in the quest for cleanness, I was wondering if 1) I had any redundant parts in there and 2) if there's an easier way to do this?