我用VB6創建一個前端,我的數據庫是Sybase。使用DSN我創建了一些小的exe來在網格中填充報表。它工作正常。在SQL比較中比較空值
但是,如果我使用下面的查詢,我只得到小時和應答數據。如果我在SQL Query中執行查詢,那麼完整的數據即將到來。
我相信總和(情況下不會在VB6工作,請指導我一個備用。
"select datepart (hh, callstartdt) as Hour, " _
& " count(seqnum) as Anaswered," _
& " sum(case when user_id <> NULL then 1 else 0 end) as answered_calls ," _
& " sum(case when user_id <> NULL and datediff (ss, callstartdt, QueueEndDt) <= 20 then 1 else 0 end) , " _
& " sum(case when user_id = NULL then 1 else 0 end), " _
& " sum(case when user_id <> NULL and datediff (ss, callstartdt, QueueEndDt) <= 20 then 1 else 0 end)/count(seqnum), " _
& " sum(Case when user_id <> NULL then 1 else 0 end)/count(seqnum) from acdcalldetail " _
& " where callstartdt between '" & fromDt & "' and '" & toDt & "' " _
& " and service_id not in (37,39,47,51,57,58,96,215,374,375) " _
& " group by datepart (hh, callstartdt) " _
& " order by datepart (hh, callstartdt)"
我有一個便條貼在我的電腦,上面寫着「 NULL總是未知「。總是看到它是有幫助的。 – 2011-01-29 18:37:37
出色答卷 - 這一個總是分不清新手 –
托馬斯...由於一噸... – DhilK