Det är din where-sats, det som filtrerar bort en viss tidsperiod. Du måste ställa in den satsen för inre val:
select Count(VisitingCount) as VisitingCount,[Time]
from
#temp as Alltimes
left outer join
( SELECT Page,Date,[user],
dbo.fn_GetActivityLogArranger2(Date,'hour') as [Time]
FROM scr_SecuristLog
where Date between '2009-04-30' and '2009-05-02'
and
[user] in
( select USERNAME
from scr_CustomerAuthorities
where customerID=Convert(varchar,4)
and ID=Convert(varchar,43)
)
) scr_SecuristLog
on Alltimes.[Time] = scr_SecuristLog.[Time]
group by [Time] order by [Time] asc