[AccessD] query help

Pedro Janssen pedro at plex.nl
Sun Nov 23 08:17:23 CST 2008


Hi John en Daren,

Thanks for your help, it works perfect
But when i see it back, i can't figure out why my mind blocked and i could't 
get it together myself.

I was trying to do it with an select distinct, but it didn't work.
The actual data are large query's, with may joins.
But your help give me the base for dealing the problem.

Best Wishes

Pedro



----- Original Message ----- 
From: "DJK(John) Robinson" <djkr at msn.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Sunday, November 23, 2008 1:00 PM
Subject: Re: [AccessD] query help


> 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
> 




More information about the AccessD mailing list