[AccessD] several query's in one!

Pedro Janssen pedro at plex.nl
Thu Dec 2 15:27:46 CST 2004


Hello Gustav,

Thanks for your help.
Everytime when i have a "difficult" query you keep amazing me by having the
answer.
Compliments, for me you are the real sql guru.

Pedro Janssen


----- Original Message -----
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Thursday, December 02, 2004 7:20 PM
Subject: Re: [AccessD] several query's in one!


> Hi Pedro
>
> Guess you could do something like this:
>
>   SELECT
>     (CoorX \ 1000) * 1000 + 500 AS CoorX0,
>     (CoorY \ 1000) * 1000 + 500 AS CoorY0,
>     SUM(IIF(FieldA Is Null, 0, FieldA) + ... + IIF(FieldE Is Null, 0,
> FieldE)) AS Total
>   FROM
>     tblCoor
>   GROUP BY
>     (CoorX \ 1000) * 1000 + 500,
>     (CoorY \ 1000) * 1000 + 500;
>
> /gustav
>
>
> >>> pedro at plex.nl 02-12-2004 15:02:23 >>>
> Hello Group,
>
> is it possible to make one sql query for the result below. Without
> using several query's to come to what is need. It would save me a lot of
> time.
>
> i have
>
> CoorX       CoorY        fieldA      fieldB     fieldC       fieldD
>  fieldE
> 206210     345120         5            1                        2
>    2
> 206733     345999         4                       2             1
>    3
> 207999     345170         1                       2             1
> 207452     345734         1            2                        2
>
> i need
>
> CoorX       CoorY        total
> 206500     345500         20
> 207500     345500          9
>
> --
> _______________________________________________
> 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