SQL server2000中convert函数的用法有关问题

SQL server2000中convert函数的用法问题?
在SQL语句中将oracle的to_date函数换成SQL   server中的convert函数这样转啊?
sql.format( "select   sum(ot_hours)   from   overtime_info_tab   "
"where   personID= '%s '   and   "
"ot_date> =to_date( '%s ', 'yyyy-mm-dd ')   "
"and   ot_date <to_date( '%s ', 'yyyy-mm-dd ')   ",
strPersonID,strMonthStart,strMonthEnd);
用的是SQL   server2000数据库,程序运行后,错误提示不能识别to_date函数,请高手帮忙将上面的to_date函数,转换成convert函数.

------解决方案--------------------
convert(varchar(10),@dt,120)转成yyyy-mm-dd格式
------解决方案--------------------
把时间转换为字符,再取位数
select convert(varchar(8),getdate(),112)--8为取的字符数,112为时间类型(设置datetime的区域格式)--楼主参照一下联机帮助写得很详细了,在帮助里检索convert就行了
------解决方案--------------------
%s 是日期型的就可以啊
sql.format( "select sum(ot_hours) from overtime_info_tab "
"where personID= '%s ' and "
"ot_date> = '%s ' "
"and ot_date < '%s ' ",
strPersonID,strMonthStart,strMonthEnd);
你试试