Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
| Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2005, 04:43 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sum a column from complex recordset

Hum, still quite new to all this and really stuck.

I have an access db with many tables. Am querying it for a large number of variables and conditions and its all fine except for one thing.

I need to take 2 filtered columns, add them together, then divide them by the SUM of another filtered comumn, to give me a percentage.

However, this is an aggregate function, and access won't let me (via dreamweaver) won't let me do this.

So, how do you sum the results of a recordset ?

Hope this makes sense to someone, am not sure on the terminology of this yet.

Many thanks,

Simon
 
Old May 5th, 2005, 07:29 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, maybe I need to explain this better. Created a recordset like this:

SELECT Mastername.Mastername, UserInformation1.F17, UserInformation4.F18, UserInformation4.F19, UserInformation4.F21, UserInformation4.F22, UserInformation4.F20, (Userinformation3.F27 + UserInformation3.F30) AS [Dollar Investment]

FROM ((Mastername LEFT JOIN UserInformation3 ON Mastername.ID = UserInformation3.ID) LEFT JOIN UserInformation4 ON Mastername.ID = UserInformation4.ID) LEFT JOIN UserInformation1 ON Mastername.ID = UserInformation1.ID

WHERE (((Mastername.Mastername)<>'Blah Blah Blah') AND ((UserInformation1.F17)<>''))
ORDER BY Mastername.Mastername

I want to add a new column in my webpage that takes

(UserInformation1.F17 + Userinformation3.F27 / SUM(UserInformation1.F17))

to give me a pecentage value for each entry.

However I get an error saying that I can't execute a query as part of an aggregate function...

Please help...




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the Sum of all the values in a column.. jhansib4u ADO.NET 1 December 1st, 2007 09:15 PM
Sum a column at the group level? srussell705 SharePoint Development 0 October 3rd, 2007 08:40 AM
Using CASE in SUM column tnzabo Oracle 1 March 26th, 2007 10:29 AM
Compute sum(column name) statement in DTS Package praragon SQL Server DTS 1 March 27th, 2006 10:23 PM
EASY ANSWER - sum of column in db nlicata Classic ASP Databases 4 August 8th, 2003 02:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.