View Full Version : weekly averages


vampke
10-30-2009, 07:03 AM
Hi guys,

I need to return a dataset to a vb.net program with weekly averages.

So far I have:

SELECT AVG(a) as A, AVG(b) as B FROM results WHERE fk=0 GROUP BY DATEPART(ww,myDateTime)


I was hoping somebody could shed some light on why this doesn't work?

DCrake
10-30-2009, 07:15 AM
Have you actually tried creating a query in Access to test this? Then look at the SQL to view the syntax.

David

vampke
10-30-2009, 07:34 AM
Have you actually tried creating a query in Access to test this?
yes

Then look at the SQL to view the syntax.

i'm not sure i get what you mean
i entered the query manually in access

lcook1974
10-30-2009, 09:06 AM
After you create the query in the QBE frame, you can select to view the SQL code. That will show you the "written" code.

vampke
10-31-2009, 08:11 AM
i didn't enter the query this way: I entered the SQL statement manually.
why doesn't it work?

lcook1974
11-02-2009, 05:56 AM
Try copy and pasting the "manual SQL" into the QBE and see if it works.