1
DataBindCrossTable(reader, "Name", "Data", Quantity", "");
的圖表顯示每單位時間量的函數的方法創建一個asp.net折線圖,從該查詢檢索
SELECT Products.Name, Shipments.Date, COUNT(Products.Name) as Quantity
FROM Product
INNER JOIN Shipments
ON Prodotto.IdProdotto = Shipments.IdProdotto
WHERE Spedizione.Date BETWEEN [date] AND [date]
GROUP BY Products.Name, Shipments.Date
ORDER BY Products.Name, Shipments.Date
(該[date]
是一個字符串)
現在,如果我嘗試從該表中創建一個圖表
+----------+-------------+----------+
| Name | Date | Quantity |
+----------+-------------+----------+
| computer | 2014-03-25 | 2 |
+----------+-------------+----------+
| stuff | 2014-04-01 | 1 |
+----------+-------------+----------+
使用這些日期圖表不會顯示第一個產品。
在調試過程中,我發現只有第二行保存在系列中,並且在圖表圖像中,x軸顯示日期從2014-03-31
到2014-04-02
。
我在做什麼錯?
另外我已經在查詢中嘗試將第一個日期更改爲2014-03-24
,並且這種方式可行,但我不想每次都操作[date]
字符串。