Adding Aggregated Columns

Aug 27, 2005

Hey,
How can I add an aggregated column to an existing query?
For example:
I have 3 fields (a, b, c), each holding numbers. I want to add a fourth field which will average or use any other aggregated function on the 3 fields (but not by doing it manually).

View Replies


ADVERTISEMENT

Create Un-aggregated Records Table

Nov 9, 2007

Hi,

I have a database that contains a table with an administration area and a number associated with the “count” of a certain characteristic of that area.

For use in another piece of software I need to convert the count system to individual records. For example I need to go from:

AREACOUNT
AdminArea13
AdminArea22
AdminArea31
AdminArea43
...

to:

AREACOUNT
AdminArea13
AdminArea13
AdminArea13
AdminArea22
AdminArea22
AdminArea31
AdminArea43
AdminArea43
AdminArea43
AdminArea43

I actually don’t need to count field in the new table, but it would be useful for my own quick reference.

The problem is that I do not have the original raw un-aggregated data – otherwise this would not be a problem. Also there is no way I can get this.

I realize that this is working in the opposite way to good normalised databases – however as I said the software that I need to export requires this data in the expanded format.

Does anyone know how I could run a query in access to achieve this?

I have large tables so will need to do this programmatically rather than manually.

Many thanks in advance.

Regards,

Kevin

View 1 Replies View Related

Trouble Reporting Aggregated Yes/No Results

Oct 24, 2004

I have a DB with multiple check boxes in each record. I want to show the total Yes responses (i.e., for all records or a group of records combined) for each check box field in a report. I am using QBE, but I'm having problems. What is the best way to do this, or at least one that works. Thanks in advance.

View 1 Replies View Related

Adding Columns Of Two Tables

Mar 9, 2005

Hi..I have three tables A ,B and C, which have fields A,B and C respectively.
I want to do that following default calulation

A.a=B.b+C.c
meaning adding two columns of different tables and storing it in a third column.
It works for me in the forms but I want to do that in the table.
Is there any way to go about it


Regards
Rahul

View 1 Replies View Related

Adding Columns To Tables

Feb 14, 2006

Background info: I have created a database that consists of 22 tables that contains hundereds of electronic components seperated by type. In each table are columns for evey project so that i can determine what projects each component is used in.

Everytime there is a new project i need to add the new column to every table. Is there a way to add the column to every table in one step rather than having to do it seperately for each table? Every table set up the same, same number of columns and column titles and everything.

Thanks

View 14 Replies View Related

Adding Columns With Fixed Value

Nov 27, 2007

I have a query that gives me a table with one column, say column A.
I need to add 2 columns to the table and the coulmns will have fixed value.
So I need to add column B and column C to my table and all rows in column B will have a fixed value and all rows in column C will have a fixed value.

What I have:
Table with one column
Column A
a
b
c

What I need:
Table with 3 columns:
ColumnA Column B Column C
a 12 14
b 12 14
c 12 14

Any help will be greatly appreciated.
Thanks

View 1 Replies View Related

Adding Up Columns Of Currency

Mar 24, 2006

when i am creating a query and need to be adding up all the data in the field, such as with the price needed to be paid overall the items, what do i have to do to create a part of the query or report to do this automatically for me? basically its a huge column of numbers that need to be simply added together and a grand total taken. please someone help. cheers.

View 3 Replies View Related

Adding Up Columns Of Currency

Mar 24, 2006

when i am creating a query and need to be adding up all the data in the field, such as with the price needed to be paid overall the items, what do i have to do to create a part of the query or report to do this automatically for me? basically its a huge column of numbers that need to be simply added together and a grand total taken. please someone help. cheers.

View 2 Replies View Related

Adding Two Columns That Both Contain Zeros

May 16, 2007

I have to add the row data in two columns together. I used

val([COLUMN 1])+val([COLUMN 2]) and it works unless one of the columns has a zero in it. For example if column 1 is 25 and column 2 is NULL it runs the query but puts a #ERROR in those rows. Please help.

View 8 Replies View Related

Error While Adding Two Columns....

Feb 21, 2008

Hi guys, Excuse my novice questions.
I have a query in which i did two things: defined a Column "Line Item Cost " as Sum ( using the dropdown in Design Grid of the query).
Then i calculated another field: Expr13 which is:
Expr 13: Sum([Line Item Cost]+ [Change Request Total Cost])

So, If Line Item Cost = 1363000 and Change Request Total Cost = -40000, then
Expr13 : 1363000-40000 = 1323000, but i am getting the values: 1283000(Somehow the value is getting doubled before addition)

Please look at the attached Document.
Please Help!

Thanks,
Kon

View 2 Replies View Related

Adding New Columns Of Sign

Oct 14, 2013

I have table with one of the columns with number (amount) that can be positive or negative.

I want to add new column of sign - 'H' for positive or 'S' for negative.

View 1 Replies View Related

Currency Columns Not Adding Up

May 6, 2014

I have a sharepoint list linked into my access database and every time when I work with queries and try to add up them up it causes the information to display in a text string. What to do in order to resolve this issue. For example, instead of $1,000+$5,000=$6,000 it will show 1,0005,000 as one string but not add them up.

View 2 Replies View Related

Adding Combo Box To One Of Columns

Sep 26, 2011

I am extremely new to access. I am trying to add a combo box to one of my columns. Basically i have about ten columns of which a couple of them I want to have combo boxes so that the information that is in each of these columns is standardized. Currently all I have is my ten columns with headings set out.

View 3 Replies View Related

Adding Columns To Pre-existing Databases?

Oct 6, 2005

I am a new MS Access user. I am having difficulty adding columns to a pre-existing database. Is there a simple way to do this?

View 4 Replies View Related

Adding Extra Columns Dynamically

Mar 5, 2007

Hi

I have 120 tables, each with the same name except 2 identifying characters at the end eg pc_dist_ab, pc_dist_al
Each table currentnly has 3 columns.
I would like to be able to add 2 additonal columns to each table with one query and was hoping an alter table query where the table name matches pattern would have worked but evidently not.

Is there a way to build some sort of dynamic query to add extra columns to these different tables at the same time?

To save another post I guess Once this is done I would then like to create 1 main table by creating a new table and appending all the files together- again I would prefer to be able to run this once.

I'd appreciate any help/thoughts as to whether this can be done?:confused:
Thanks

View 1 Replies View Related

Adding Lookup Columns To A Table

Sep 21, 2015

In the tutorial listed here: [URL]....

It states after opening the database in Datasheet view :

In the Navigation pane, double-click the table in which you want to create the lookup column - this opens the table in datasheet view.

On the Datasheet tab, in the Fields & Columns group, click the lookup column.

And it show you some icons.

View 1 Replies View Related

Queries :: Execute Query That Doesn't Include Specified Expression As Aggregated Function

Mar 21, 2013

I am receiving this error when i try to run a query:

"You tried to execute a query that doesn't include specified expression as an aggregated function"

There are two images attached which show the SQL view, the error and the design view.

View 11 Replies View Related

Dynamically Adding Multiple Columns Question

Nov 12, 2005

I coulnt figure out how to reply to a reply. This is a follow up question to a previous post.

I can now create a new column in my access db through my web form.

Here is the script:
ALTER TABLE FAQ ADD City varchar(30)

this adds a new column called city.
Here is my problem:
Every time a user asks a question, that question will be in the new column created.
I need the newly created columns to have unique names.
I tried creating a form with a text file (to simulate where they type in their question) then post to post.asp.
post.asp holds the script.
I replaced city with ::T1:: (the variable of the text file), but got an error.

Creating columns dynamically is worthless unless there is a way to make the column names unique.

Can anyone shed some light on this problem for me?

Much appreciated

Mike

View 3 Replies View Related

Tables :: Adding Same Prefix To All Columns In A Table

Jan 23, 2013

My database has three tables with many columns. The three tables are identical in the names of their columns.

I want to copy all columns from all three tables together into one single table, giving the respective columns prefix table1-, table2-, table3- since the columns would otherwise be indistinguishable.

I already tried to search the board for "table columns add prefix".

I use Access 2010

I managed to copy all columns together into one table through design-view, but cannot figure out the "add prefix" step.

View 9 Replies View Related

General :: Manipulate Forms - Adding Two Columns

Jul 13, 2014

Access file attachment in the form below if you want to add two columns (like other columns with the capability to filter).

Link file attachment : [URL] ....

View 14 Replies View Related

Adding Columns To Existing Access 2003 Table

Jun 3, 2005

Hi,
I am fairly new to doing DBA, and I am having trouble adding a new column to a table that is existing. Is there any simple way to do this or does it have to be done throught code? And if so how.
Thanks
zorter8

View 1 Replies View Related

Reports :: Adding Another Field In Report To Show Percentage Of Two Columns

Sep 2, 2014

I have two collums, currentowed and currentpaid. i want to add another field to my report showing the percent of currentpaid to currentowed but I can't seem to be able to make it work. I tried:

=sum([currentpaid]/[currentowed]) and it doesn't work.

View 3 Replies View Related

Adding Values In Separate Columns Dependent On Text In Another Column?

May 16, 2013

I'm trying to make a database to track inventory or several items. Basically, I have four tables:

1) RawMaterialList - includes a list of all raw materials.
2) PartList - includes a list of all finished product using said raw materials.
3) RawMaterialRecieving - contains details from each packing slip of incoming raw materials.
4) ShipmentRecord - contains details of daily shipments.

Each of these tables is fed by a form of the same name. I should note at this point that I basically taught myself how to use Access and I imagine I'm in the dark about quite a few things it can do. I've made several databases over the last few years, but I'm stumped at this point.

Here's my problem. In the form RawMaterialReceiving, I have several fields aside from basic information:

1) Item - a list of of raw materials from table RawMaterialList
2) Description - also dependent on info entered into table RawMaterialList
3) Quantity

But, I have 12 of these instances.

Item1, Item2...Item12;
Description1, Description2...Description12;
Quantity1, Quantity2...Quantity12.

My problem is I want to add up the quantities of each raw material and I'm not sure how to go about that. Lets say on May 13, I received 15pcs of Part A and 20pcs of Part B. I enter this information as Item1 and Item2 respectively. On May 14, I received 30pcs of Part B. I enter this information under Item1. Now I want to add up all of Part B (50 pcs). But Part B has one value listed in the field Quantity1 and one value listed in the field Quantity2.

Example:

1st Entry:
May 13
Item1 = PartA Description1 = PartA's description Quantity1 = 15
Item2 = PartB Description2 = PartB's description Quantity2 = 20

2nd Entry:
May 14
Item1 = PartB Description1 = PartB's description Quantity1 = 30

How do I get it to add up Part B to get 50pcs?

View 10 Replies View Related

Access Reports: Adding Lines To Separate Rows And Columns Like Excel

Nov 4, 2004

Ive been converting .xls files to Access database files. I would like to use ACCESS to develop the Reports but the client wants the Reports to look like those in EXCEL..eg. where you have lines between rows and columns. If I could give my Access Reports the same look and feel, I could wean these guys off of Excel and into the wonderful world of relational models.

Does anyone have sqlcode or tricks I might use to create the Excel 'look alike' report in Access?

thks in advance...and I will sum.

the ravenman.

View 1 Replies View Related

Queries :: Adding Calculations To Queries Based On Columns In Query

Feb 18, 2014

I am trying to add calculations to queries based on columns in the query... it seems to randomly expect 'Expression' or 'Group by' as column types, and Im having to create 3 sets of queries following on from each other to de-dupe data and allow filters on calculated values.

Also I've got a function which turns a date into a quarterly cohort, e.g. Oct 2013 -> 20134. I use ot on a lot of dates. I created a VBA function, CohortQ used as follows in queries:

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 CohortQ([InputDate]))

In the VBA, InputDate is defined as a date

Code:
Function CohortQ(InputDate As Date) As Integer
If InputDate = 0 Then
CohortQ = 0
Exit Function
End If

[Code] .....

But when I run it on a date field, it gives me a data mismatch error. I can't step through as it's working on 600K rows.
If I put the function into the query,

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 Year([InputDate])*10+DatePart("q",[InputDate]))

it works.

View 3 Replies View Related

Modules & VBA :: Union All Query - Transposing Columns To Rows With Variable Columns?

Aug 8, 2013

I was able to use the UNION ALL qry. But, when I have another file (like original2) that does NOT have all the columns listed in the UNION ALL qry, I get a Parameter value box asking for the missing columns when I run the qry.

Example:

original1IDDateGroupChristianJohnnySteve 18/5/2013A1528/5/2013B338/5/2013C2348/5/2013D2358/5/2013E5

original 2IDDateGroupChristianJohnny18/6/2013A212528/6/2013B2338/6/2013C2248/6/2013D22

The UNION ALL qry includes all the possible resources ( includes all the possible column fields Christan, Johnny, and Steve).

When I run the UNION ALL qry with the original2 file, An "Enter Parameter Value" box is displayed with the mssing column name "Steve".

Is there a way to Map the original2 table into a working table with all the columns, or use VBA code to construct the UNION ALL qry to only include the existing columns? My data has variable columns and I'm trying to avoid the parameter popups.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved