为什么下面这句没有问题
AND "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" = "&chr(39)&"2012-11-6 19:23:04"&chr(39)&"但是
AND "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" = getdate()
就提示Column not found使用getdate()导致报错,所以未能打印出sql语句(因为用的是aa.vbs类似这样的文件)
AND "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" = "&chr(39)&"2012-11-6 19:23:04"&chr(39)&"但是
AND "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" = getdate()
就提示Column not found使用getdate()导致报错,所以未能打印出sql语句(因为用的是aa.vbs类似这样的文件)
DateTime.New.ToString()
getdate()换成now()也是同样提示Column not found."SELECT "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Assigned To individual+"&chr(34)&", "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" from "&chr(34)&"HPD:HelpDesk"&chr(34)&" "&chr(34)&"HPD:HelpDesk"&chr(34)&" WHERE (datediff(mi, "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&",getdate()) > 30) ORDER BY "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Case ID+"&chr(34)&""
SELECT "HPD:HelpDesk"."Assigned To individual+", "HPD:HelpDesk"."Create Time"
from "HPD:HelpDesk" "HPD:HelpDesk" WHERE (datediff(mi, "HPD:HelpDesk"."Create Time",getdate()) > 30)
ORDER BY "HPD:HelpDesk"."Case ID+"
报的是列名没找到,那就看你的表结构,不是getdate()有错
WHERE "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Create Time"&chr(34)&" = "2012-11-6 19:23:04"这样就不报错,但是用datediff和getdate()的时候就报Column not found。