我用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