我要统计每周的数据
我要从起始时间开始统计每周的数据直至终止时间
比如
我想统计从2006-4-3到2006-12-30这段时间内,aa表中字段d 每周的数据,
请问sQL语句怎么写啊
------解决方案--------------------idate= "2006-07-15 " '初始日期
iidate= "2006-08-02 " '结束日期
do while datediff( "d ",idate,iidate)> =0
iiidate=dateadd( "ww ",1,idate)
sql= "select sum(d)as xxx from aa where cast(日期字段 as smalldatetime) between ' "&idate& " ' and ' "&iiidate& " ' "
set rs=server.createobject( "adodb.recordset ")
rs.open sql,conn,1,1
xx=rs( "xxx ")& "||| <br> "
rs.close
response.write xx
idate=iiidate
loop