0
這裏有一臺,從字面上有我拉我的頭髮:訂購
如果我使用下面的代碼:
SQL = "SELECT * from Incident WHERE"
SQL = SQL & " active=1 ORDER BY incidentdate"
Recordset.Open SQL,Connection
Do While NOT Recordset.Eof
idate = FormatDateTime(Recordset("incidentdate"),vbShortDate)
inumber = Recordset("incidentnum")
Response.Write inumber & "<br />" & vbCrLf
Response.Write idate & vbCrLf
Recordset.MoveNext
Loop
我得到以下輸出:
2015-U1-FO-001
01/17/2015
如果我在Do While...
行之後切換行,所以我的代碼如下所示:
SQL = "SELECT * from Incident WHERE"
SQL = SQL & " active=1 ORDER BY incidentdate"
Recordset.Open SQL,Connection
Do While NOT Recordset.Eof
inumber = Recordset("incidentnum")
idate = FormatDateTime(Recordset("incidentdate"),vbShortDate)
Response.Write inumber & "<br />" & vbCrLf
Response.Write idate & vbCrLf
Recordset.MoveNext
Loop
名
我的輸出更改爲:
2015-U1-FO-001
12/30/1899
這似乎引起Recordset("incidentdate")
返回一個空字符串。
關於我所忽略的任何想法?
入射一個看法? IncidentDate是否有CASE(或COALESCE/ISNULL)?我已經看到類似的邊緣案例根據執行計劃在SQL Server中出現......但我不確定爲什麼執行計劃會在這兩種情況下發生變化。 – 2015-01-20 23:20:05
可以做更多的細節,是'事件'的表或視圖,你可以發佈視圖架構? – Lankymart 2015-01-20 23:34:40