Stuart McLachlan
stuart at lexacorp.com.pg
Sun Nov 23 17:25:37 CST 2008
Duhh! I wasn't thinking :-( On 23 Nov 2008 at 12:00, DJK(John) Robinson wrote: > Fine, Stuart, except for using First (which will often give Null). Sum, Min > or Max are equally OK for Pedro's example, though maybe not for his real > problem - we can't tell! :-) > > John > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: 23 November 2008 11:41 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] query help > > > You need something like: > Select Distinct [Date],ax,ay,spec,First(mm),First(vv),First(egg),First(Larf) > > >From tblMyTable > Group By [Date],ax,ay,spec > Order by [Date],ax,ay,spec > > You may want to replace First() with Sum(),Min() or Max() depending on > exactly h what you > actual data is and what results you want > > On 23 Nov 2008 at 11:28, Pedro Janssen wrote: > > > Dear Group, > > > > can you help me with a query? > > > > > > I have: > > > > Date ax ay spec > mm vv egg Larf > > > > 01-01-01 123 123 A > 1 > > > > 01-01-01 123 123 A > 3 > > > > 01-01-01 123 123 A > 45 > > > > 01-01-01 345 345 A > 1 > > > > 02-02-02 678 678 B > 12 > > > > 02-02-02 678 678 B > 4 > > > > > > > > > > > > i want > > > > > > > > Date ax ay spec > mm vv egg Larf > > > > 01-01-01 123 123 A > 1 3 45 > > > > 01-01-01 345 345 A > 1 > > > > 02-02-02 678 678 B > 12 4 > > > > > > > > > > > > > > > > How can i do this in a single query? > > > > > > > > Thanks > > > > > > > > Pedro > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com