>>>I missed this reply you wrote. Just to clarify it in my thick head, is {ts 'YYYY-MM-DD 00:00:00'} the same as 'YYYY-MM-DD' or as 'YYYY-MM-DD HH-MM-SS'?
>>>
>>They are both the same if you use 00:00:00 for time portion.
>
>Thanks.
Yes, that's the same. Check
http://www.karaszi.com/SQLServer/info_datetime.asp#DtInSqlServer
If it's not broken, fix it until it is.
My Blog