Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Mon, 13 Oct 2008 14:13:58 -0700 (PDT),    group: microsoft.public.access.queries        back       


Running an SQL Statement with a GROUP BY Clause   
Running an SQL Statement in Access

I'm trying to run the following query in access:

SELECT Average([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
Duration, [Trade Data].Manager
FROM [Trade Data];
GROUP BY [Trade Data].Manager

It is giving me this error message:

The LEVEL clause includes a reserved word or argument that is
misspelled or missing, or the punctuation is incorrect.

What am I doing wrong?
date: Mon, 13 Oct 2008 14:13:58 -0700 (PDT)   author:   unknown

Re: Running an SQL Statement with a GROUP BY Clause   
nouveauricheinvestments@gmail.com wrote:
> Running an SQL Statement in Access
>
> I'm trying to run the following query in access:
>
> SELECT Average([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
> Duration, [Trade Data].Manager
> FROM [Trade Data]; <====
> GROUP BY [Trade Data].Manager
>
> It is giving me this error message:
>
> The LEVEL clause includes a reserved word or argument that is
> misspelled or missing, or the punctuation is incorrect.
>
> What am I doing wrong?

Putting a semicolon at the end of your FROM clause (see the arrow
above).

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
date: Mon, 13 Oct 2008 17:25:19 -0400   author:   Bob Barrows [MVP] com

Re: Running an SQL Statement with a GROUP BY Clause   
On Mon, 13 Oct 2008 14:13:58 -0700 (PDT), nouveauricheinvestments@gmail.com
wrote:

>Running an SQL Statement in Access
>
>I'm trying to run the following query in access:
>
>SELECT Average([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
>Duration, [Trade Data].Manager
>FROM [Trade Data];
>GROUP BY [Trade Data].Manager
>
>It is giving me this error message:
>
>The LEVEL clause includes a reserved word or argument that is
>misspelled or missing, or the punctuation is incorrect.
>
>What am I doing wrong?

Using the unrecognized function Average instead of the builtin Avg() operator,
for one thing. The excessive semicolon is probably a problem too.

You should probably also use the DateDiff() function to calculate the duration
instead of subtracting, unless you want the duration in fractional days.

-- 

             John W. Vinson [MVP]
date: Mon, 13 Oct 2008 17:18:31 -0600   author:   John W. Vinson

Re: Running an SQL Statement with a GROUP BY Clause   
I'm still getting an error message...This is what I have...I just
copied and pasted...

SELECT Avg([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
Duration, [Trade Data].Manager
FROM [Trade Data];
GROUP BY [Trade Data].Manager

Mind you, I don't really know what I'm doing, so that is probably the
problem...lol This is baptism by fire...
date: Tue, 14 Oct 2008 06:07:54 -0700 (PDT)   author:   unknown

Re: Running an SQL Statement with a GROUP BY Clause   
On Oct 14, 7:07 am, nouveauricheinvestme...@gmail.com wrote:
> I'm still getting an error message...This is what I have...I just
> copied and pasted...
>
> SELECT Avg([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
> Duration, [Trade Data].Manager
> FROM [Trade Data];
> GROUP BY [Trade Data].Manager
>
> Mind you, I don't really know what I'm doing, so that is probably the
> problem...lol This is baptism by fire...

oh crap...I thought you were saying I should put a semicolon there...I
removed it and it worked like a charm...
date: Tue, 14 Oct 2008 06:09:39 -0700 (PDT)   author:   unknown

Re: Running an SQL Statement with a GROUP BY Clause   
You still did NOT remove the semi-colon in the FROM line.

SELECT Avg([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
Duration, [Trade Data].Manager
FROM [Trade Data]
GROUP BY [Trade Data].Manager


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

nouveauricheinvestments@gmail.com wrote:
> I'm still getting an error message...This is what I have...I just
> copied and pasted...
> 
> SELECT Avg([Trade Data]![End Time]-[Trade Data]![Start Time]) AS
> Duration, [Trade Data].Manager
> FROM [Trade Data];
> GROUP BY [Trade Data].Manager
> 
> Mind you, I don't really know what I'm doing, so that is probably the
> problem...lol This is baptism by fire...
date: Tue, 14 Oct 2008 09:17:39 -0400   author:   John Spencer

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us