在问查询异常,请高手赐教

在问查询错误,请高手赐教。
VB code
Private Sub Command1_Click()
Adodc1.RecordSource = "select STCD,sum(isnull(DRP,0)) as DRP From ST_PPTN_R where TM between  cast ('" & DTPicker2.Value & "" & Text3.Text & ":00:00' as datetime )   and   cast ( '" & DTPicker3.Value & "" & Text4.Text & ":00:00' as datetime)  Group By STCD"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1.Recordset
DataGrid1.Refresh

说明:vb6.0中用DTPicker控件来显示日期,用Text控件显示的数值表示整时,分秒默认为:00:00。
select 语句是要查询DTPicker控件和Text控件显示的时间之间的数据。
sql数据库表中字段TM的数据类型是datatime,存储现实是(2011-5-19 18:00:00).
运行上面程序,出现错误是“从char数据类型到datetime数据类型的转换导致datetime值越界”
上面错误怎么改正?或还有其它代码能现实其功能?



------解决方案--------------------
format(dtpicker2.Value,"yyyy-mm-dd")
这样试试
------解决方案--------------------
format(dtpicker2.Value,"yyyy-mm-dd") & “ ” & text3.text & ":00:00"
------解决方案--------------------
http://download.csdn.net/source/1644211