[AccessD] complex query!!

Pedro Janssen pedro at plex.nl
Thu Jan 13 13:51:49 CST 2005


Hello Gustav and Rob,

thanks for the help.
GROUP BY on the fields to, was something i must had noticed myself.

Greetings Pedro



----- Original Message ----- 
From: "Bob Hall" <rjhjr at cox.net>
To: <accessd at databaseadvisors.com>
Sent: Wednesday, January 12, 2005 10:20 PM
Subject: Re: [AccessD] complex query!!


> On Wed, Jan 12, 2005 at 09:05:41PM +0100, Gustav Brock wrote:
> > Hi Pedro
> > 
> > Bob is right but you need to Group By on the fields too:
> > 
> >   SELECT 
> >     Avg(tblGroup1.FieldA+tblGroup2.FieldB)/2 AS Avg2
> >   FROM 
> >     tblGroup1,
> >     tblGroup2
> >   GROUP BY 
> >     tblGroup1.FieldA,
> >     tblGroup2.FieldB;
> 
> If that's what Pedro wants, then he doesn't need Avg(). 
> SELECT (tblGroup1.FieldA+tblGroup2.FieldB)/2 AS Avg2
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 





More information about the AccessD mailing list