Hi,
wonder if someone can help me
when siteid is null in the subquery, the count returned is 0. is there any way to return a value when the siteid is null. i tried setting ansi_nulls off but it doesnt seem to work in this subquery. heres the sql:
set ansi_nulls off
insert into [stats](StatDate,SiteID,SiteName,StatType,UniqueHits,TotalHits,JoinHits)
select *, JoinHits = (select count(*) from referer where refdirection='OUT' and RefType=#TempItems.StatType and refdate=#TempItems.StatDate and siteid=#TempItems.SiteID)
from #TempItems order by statdate,stattype
set ansi_nulls on
TIA
alan
wonder if someone can help me
when siteid is null in the subquery, the count returned is 0. is there any way to return a value when the siteid is null. i tried setting ansi_nulls off but it doesnt seem to work in this subquery. heres the sql:
set ansi_nulls off
insert into [stats](StatDate,SiteID,SiteName,StatType,UniqueHits,TotalHits,JoinHits)
select *, JoinHits = (select count(*) from referer where refdirection='OUT' and RefType=#TempItems.StatType and refdate=#TempItems.StatDate and siteid=#TempItems.SiteID)
from #TempItems order by statdate,stattype
set ansi_nulls on
TIA
alan