asp分割字符的问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 06:47:28
在数据库中提取了一个字段 rs(text_time)并输出之后得到
2009-3-28 15:38:39
2009-3-26 19:13:28
2009-3-26 19:11:56
2009-3-26 19:11:56 ....
请问怎样载取2009-3-26前半部分,不要19:11:56 后半部分?
其实写了下面几行,用不了:
dim text_time,arr_time()
text_time=rs("text_time")
arr_time=split(text_time,"")

出现:
遇到未处理的数据类型

这个是时间,不要用成文本字符。把字段设置成时间类型,然后用year month day 提取年月日,或者直接用formatdatetime(xxxx,vbShortDate).

response.write dateValue("2009-3-26 19:11:56")

response.write dateValue(rs("text_time")
)