html的SelectCommand寫法記錄
SelectCommand="SELECT [Date], [RDate], [DID], [PID], [INO], CASE [Type]
WHEN 'A' THEN 'A號'
WHEN 'B' THEN 'B號'
WHEN 'C' THEN 'C號'
WHEN 'D' THEN 'D號'
WHEN 'E' THEN '進度'
END AS [NWType] ,[IP] FROM [Log]
WHERE ([IP] = @IP)
order by [Date] DESC">
"SELECT [IP],COUNT(IP) AS [COUNT_IP] FROM [RLog] WHERE (([LogD] >= @LogD) AND ([LogD2] <= @LogD2)) GROUP BY [IP] HAVING COUNT(IP) > 0 AND ip <> '' order by COUNT_IP DESC ">
這樣只會跑出 6/1的資料,不會跑出6/2的資料
where LogDate >= '2015-06-01'
AND LogDate <= '2015-06-02'
這樣會跑出6/1、6/2
where LogDate BETWEEN '2015-06-01' AND '2015-06-02'
沒有留言:
張貼留言