Problems with Date Add

G

Guest

the following friday. Unfortunately the summation part of the query only
returns values from sunday to the following saturday therefore i am always
retrieving the wrong saturdays data.

Any help would be most appreciated.

PMK

SELECT Format(DatePart("ww",[Daterequired]),"00") & " " &
DateAdd("d",-Weekday([Daterequired])+0,[Daterequired]) & " and " &
DateAdd("d",-Weekday([Daterequired])+6,[Daterequired]) AS [Between],
Sum(Diary.Value) AS SumOfValue
FROM Diary
GROUP BY Format(DatePart("ww",[Daterequired]),"00") & " " &
DateAdd("d",-Weekday([Daterequired])+0,[Daterequired]) & " and " &
DateAdd("d",-Weekday([Daterequired])+6,[Daterequired]),
Format([DateRequired],"yyyy")
ORDER BY Format([DateRequired],"yyyy") DESC ,
Format(DatePart("ww",[Daterequired]),"00") & " " &
DateAdd("d",-Weekday([Daterequired])+0,[Daterequired]) & " and " &
DateAdd("d",-Weekday([Daterequired])+6,[Daterequired]) DESC;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top