Sad Der
accessd666 at yahoo.com
Wed Mar 2 05:50:08 CST 2005
A very nice solution! Lets check the performance. Thnx Gustav. --- Gustav Brock <Gustav at cactus.dk> wrote: > Hi Sander > > That could be: > > SELECT > SUM(ABS(CATEGORY='NP')*POSITION) AS [New Pos], > SUM(ABS(CATEGORY='NZ')*POSITION) AS [Old Pos], > SUM(ABS(CATEGORY='DD')*POSITION) AS [Delivered] > FROM > tblYourTable; > > /gustav > > >>> accessd666 at yahoo.com 02-03-2005 08:35:24 >>> > Hi group, > > I've got a table with a field called [category] and > a > field called [position]. > > I need a query that has several output fields: > New Pos, Old Pos, Delivered > > The calculation for these fields is as follows: > New Pos = SUM(POSITION) WHERE CATEGORY = "NP" > Old Pos = SUM(POSITION) WHERE CATEGORY = "NZ" > Delivered = SUM(POSITION) WHERE CATEGORY = "DD" > > But how do I create a query that spits out these > values?? > > Thnx. > > Sander > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/