以下查询给出了这个错误
The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
字段 timedate 在数据库中看起来像 13/11/2012 uk 格式。
任何人都知道如何解决这个问题。
SELECT
PRODID, ITEMDES, QTY, StockCode,shipName, shipCompany, shipAddress1, shipAddress2, shipAddress3,shipPostCode,shipcity,shipCountry,shipCounty,customerMessage
FROM orderedItems oi
left join orders o on oi.order_id = o.order_id
where( CONVERT(nvarchar(30),timedate,120) >=
<cfqueryparam cfsqltype="cf_sql_date" value="#LSDateFormat(form.fromDate, "yyyy-mm-dd")# 00:00:00">
AND CONVERT(nvarchar(30),timedate,120) <=
<cfqueryparam cfsqltype="cf_sql_date" value="#LSDateFormat(FORM.toDate, "yyyy-mm-dd")# 23:59:59">
)
Group by PRODID,ITEMDES,QTY, StockCode,shipName, shipCompany, shipAddress1, shipAddress2, shipAddress3,shipPostCode,shipcity,shipCountry,shipCounty,customerMessage
ORDER BY PRODID