этот запрос дает мне "Неверный синтаксис рядом с ключевым словом" выбрать "." посмотрите пожалуйста ниже области жирного символа.
declare @date1 smalldatetime, @date2 smalldatetime, @page nvarchar(100) ,@sum int
select @date1='2009-06-06',@date2='2009-06-13',@page='Tüm Sayfalar'
<b>set @sum = select Sum(t.[VISITINGCOUNT]) from</b>
(
select count(page) as [VISITINGCOUNT],
cast(DATENAME ( year ,DATE)+'-'+DATENAME (month ,DATE)+
'-'+DATENAME (day ,DATE) as smalldatetime) as [DATE]
from scr_StatisticaLog
where Date between @date1 and @date2
and (Page=@page or @page='Tüm Sayfalar') and ProcessType='PageView'
GROUP BY
cast(DATENAME ( year ,DATE)+
'-'+DATENAME (month ,DATE)+
'-'+DATENAME (day ,DATE) as smalldatetime)) as t
select 100*(t.[VISITINGCOUNT]/@sum),t.[DATE] from
(
select count(page) as [VISITINGCOUNT],
cast(DATENAME ( year ,DATE)+'-'+DATENAME (month ,DATE)+
'-'+DATENAME (day ,DATE) as smalldatetime) as [DATE]
from scr_StatisticaLog
where Date between @date1 and @date2
and (Page=@page or @page='Tüm Sayfalar') and ProcessType='PageView'
GROUP BY
cast(DATENAME ( year ,DATE)+
'-'+DATENAME (month ,DATE)+
'-'+DATENAME (day ,DATE) as smalldatetime)) as t