[AccessD] several query's in one!

Mark A Matte markamatte at hotmail.com
Thu Dec 2 12:36:06 CST 2004


Pedro,

This doesn't take into account NULLS and assuming you were just taking the 
first 3 digits of CoorX and Y...then adding 500 to the end...you could use 
something like:

**********************
SELECT Left([CoorX],3) & "500" AS X, Left([CoorY],3) & "500" AS Y, 
Sum([fieldA]+[fieldB]+[fieldC]+[fieldD]+[fieldE]) AS Total
FROM tblData
GROUP BY Left([CoorX],3) & "500", Left([CoorY],3) & "500"
WITH OWNERACCESS OPTION;
******************
...and you output would look like:
X	Y	Total
206500	345500	20
207500	345500	9

Hope this helps...

Thanks,

Mark A. Matte


>From: pedro at plex.nl
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: accessd at databaseadvisors.com
>Subject: [AccessD] several query's in one!
>Date: Thu, 02 Dec 2004 15:02:23 (MET)
>
>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
>
>
>Thanks
>
>Pedro  Janssen
>
>--
>_______________________________________________
>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