Creating A Query To Add Up Numbers

Mar 18, 2008

Hello

Bascially I am trying to make a query to check if certain Parameters are met over all in the table then add up records.

For example i have a record set up like

Bob Brown|Access Programmers|18/3/08|1
Bob Brown|Access Programmers|17/3/08|5

I would want to make a query compound those records up in a report (e.g the compounded values don't need to be saved just displayed)

If the records name field is the same and the dates fall in a certain range then the records will be compounded together e.g the numbers being added up

So the end result for that example would be

Bob Brown|Access Programmers|6

Because the records name and "Access Programmers" is the same and they fall within a certain date range the records are compounded together

My question is, Would you make a query to do that or can it be done with a report. Bascially what would be the best way to do it.:)

Thankyou In Advance!

View Replies


ADVERTISEMENT

Creating Consective Numbers

Jul 30, 2006

I am creating an ordering system in which I want to create an reference number per order but do not want to use the Autonumber facilities since it is to easy for the number to be lost in error.

I want to create a query which will generate a reference number on saving.

Can anyone help me?

View 2 Replies View Related

Queries :: Search For Multiple Plot Numbers Preferably In One Parameter Prompt With Comma To Separate Numbers

Aug 12, 2014

I'm having multiple problems with my database like things such as -

i'm currently working on the Query 2 - On the Phone database (ignore Query 1) and i want to search for multiple plot numbers preferably in one parameter prompt with a comma to seperate numbers. (this could be a multitude of numbers so i would like to be able to input as many as needed). Also when i do search on this query since the Criteria is a 'Between' Value i would expect everything between the 2 numbers input to show up - but a lot of numbers out of the range show up too - why is this? (The Numbers are like "69 to 136" and they will show up - but 1-69 and 136-170 would too

I would also like to implement the search results from Query 2 into the Form i currently have made but it just opens up a access table when the search is made?

i cannot link my database as it is too big for the server - But here are the Criteria for Query 2:

Plot No - (criteria = Between [Enter First Plot No:] And [Enter Last Plot No:])
Site - (criteria = Like "*" & [Enter Site:] & "*")
Product - (criteria = Like "*" & [Enter Product:] & "*"

The Query is the one im most concerned about , i can live without a form.

View 14 Replies View Related

Numbers Stored As Text Convert To Numbers?

Jan 10, 2007

Ok so in excel I have some numbers that are stored as text. The reason being that they are zip codes and some begin with 0 and excel doesn't want numbers to start with 0....so when I import these into an access field that has an input mask for zip codes...will it convert these correctly since the field is a text with input mask?

View 1 Replies View Related

Modules & VBA :: Automate Line Numbers And PO Numbers

Aug 24, 2014

I have 2 fields that I would like to automate if possible

One field is called "p/o number" and another field called "line no"

These fields are part of an ordering database

Let say I have 200 items to purchase form 10 suppliers

And form example 20 items from each supplier

What I do at present is put the order number on each line item and the line number

example

p/o number line no

1 1
1 2
1 3

2 1
2 2
2 3
2 4

What I want to do is just put the first po number in the required line . Put the first line number in i.e. "1" and the macro will complete all the p/o numbers and line numbers for me as per the ones marked in red.

Example

1 1
2 2
3 3

2 1
2 2
2 3

View 5 Replies View Related

Tallying Numbers In My Query

Sep 21, 2005

I have got a big data base (40mb) and i am currently trying to run a query which i need help with.

In my database i different parts which are graded by levels e.g.

Part Level

Nut 2
Bolt 1
Pipe 2

In my query i want to run it so that i will have column headings e.g.

Level 1 Level 2 Level 3

and under each heading there will be a total of the number of parts under each level e.g. under level 1 there will be a one, under level 2 there will a 2 sourcing from the above data example.

Please help!!

View 4 Replies View Related

Row Numbers In Join Query

Apr 9, 2008

I've have used the usual code format for creating a column of row numbers for my query, but it doesn't seem to work. Sequence: DCount("InventoryID","Chemical Location","InventoryID <=" & [InventoryID]) I got this error The Microsoft Office Access database engine cannot find the input table or query 'Chemical Location'. Make sure it exists and that its name is spelled correctly.

So I tried this: Sequence: DCount("InventoryID","qexpFacilityInventory","InventoryID <=" & [InventoryID])And I got this error: The expression you entered as a query paramenter produced this error: Business Emergency Plans can't find the form 'frmMain' referred to in a macro expression or Visual Basic code

I think my code doesn't work because its a join query; so I'm searching for an answer. I have attached an image of the query builder in Access 2007 to show my problem. Also I'm showing the SQL code. Can someone help me with putting row numbers in a Join Query "qexpFacilityInventory"?
SELECT tblChemicalInventory.[Business Name], tblChemicalInventory.[Item Number], tblChemicalInventory.[Chemical Location], tblChemicalInventory.[Chemical Name], tblChemicalInventory.[Common Name], tblChemicalInventory.[Map ], tblChemicalInventory.[Grid ], tblChemicalInventory.[Largest Container], tblChemicalInventory.[Average Daily Amount], tblChemicalInventory.[Maximum Daily Amount], tblChemicalInventory.Units, tblChemicalInventory.[Storage Container], tblChemicalInventory.[Usage Purpose], tblChemicalInventory.[Annual Waste Amount], tblChemicalInventory.STATUS AS Reviewer, tblChemicalInventory.STATUS AS [Modified Yes/No], tblChemicalInventory.STATUS AS Comments
FROM tblChemicalInventory INNER JOIN tblChemicalProperties ON tblChemicalInventory.ChemicalID = tblChemicalProperties.ChemicalID
WHERE (((tblChemicalInventory.BusinessID)=[Forms]![frmMain]![ctlGenericSubform].[Form]![BusinessID]));


Thanks,
PC

View 1 Replies View Related

Need A Query Combining Non-used ID Numbers And The MAX + 1

Oct 10, 2005

I'm trying to create a combo box that would show the next ID number available to name a piece of equipment, as well as any numbers in the range that can be recycled.

This is in an equipment database where the equipment is named using the following convention: Division - equipment type - #. For example, a PC would be: DIV1-CPU-0001. My current drop down box generates the next number (so you can see the next ID for DIV1-CPU-0002). It's just a MAX+1 query.

However, if we have 10 PCs and DIV1-CPU-0008 was stripped and sent to recycling, then 8 is available as an ID number. I want my drop-down box to show, in that case, "8" and "11" as the options.

I've created a table with all the numbers and created queries that show which ID numbers aren't in use for each type of equipment. However, I can't figure out how to put all this in one query for my combo box.

Thanks!

View 2 Replies View Related

Real Simple: Add Together 2 Numbers In Query?

Aug 26, 2005

Hello, how do i add 2 field numbers in a query together, i have the fields: "basic hours" & "overtime", and a "total". I would like the "total" field to add basic hours & overtime together.

I believe i need to use the =sum function in the query on the criteria bit, is that right?....but forgot what to do :o please help?

View 10 Replies View Related

Create Index Numbers In A Query

Mar 23, 2005

Basically I want to run a query that adds an index number against each record returned, however I want the index number to reset every time a name in a field changes e.g.

Date Name Index

01/01/05 Smith 1
01/01/05 Smith 2
02/01/05 Smith 3
04/01/05 Smith 4
01/01/05 Jones 1
03/01/05 Jones 2
01/01/05 Davies 1
02/01/05 Davies 2
06/01/05 Davies 3
07/01/05 Davies 4
As you can see the index is reset at each change of name.

Is this possible ?

View 10 Replies View Related

Modules & VBA :: Calculate Numbers In Query

Mar 1, 2015

I am looking to calculate numbers in query like this if the field name in query is Unit and the second field name is amount and i want that the amount field to calculate the unit field on this criteria..Suppose if total unit is 393 so the calculation should be like this;

First hundred should be calculated with 100.00 X 5.79 = 579.00
Second 200.00 X 8.11 = 1622.00
Third 93.00 X 12.33 = 1146.69

Total should be displayed in the amount field = 3347.69

View 14 Replies View Related

Format Numbers In Query Text Field?

Nov 10, 2005

I have a field in a query that contains numbers and text (text field). The numbers displayed come from a percent calculation and display with many decimals ie, .99898745987245. Is there a way to eliminate the decimals with code in the query field? For example .99898745987245 to equal 99%? I can’t format the field as a number or percent because it has both text and numbers. HELP!!
Thanks

View 5 Replies View Related

Update Query With Rnd (random Numbers) Question

Nov 30, 2006

Hello Everyone,

Im trying to make a query which will allow me to run a query update so that all my listings will get a new random number generated for them,

Ive got it selecting any listing with a ID of >0 (so basically thats all of the listings)

What id like it to do is then assign a random number to the randsort field, (prefer a number like 0.812 or 0.342 etc etc)

To start with ive tried using the Rnd feature, but its updating all the listings with exactly the same number (though granted the number changes each time the query is run)

I see in some of the other comments regarding rnd that you may need to put a randomize statement somewhere,

Im very new to programming in access and was just wondering am I on the right track, and if so where abouts should i declare the randomize code since its in a query?

Thanks for your time and look forward to your replies
Cheers Ezy

View 6 Replies View Related

How To Make A Query To Determine The Difference In Two Numbers

Jun 21, 2007

I am making a query and I need to be able to determine if two number fields are with in 2.5% of each other. How would be the best way to go about doing this. I have two distances and I need to display them if there is a differenece of greater than 2.5% in them.

View 3 Replies View Related

Record Numbers, Not Data, Being Shown In Query

Apr 2, 2008

Hello again,

A while back, I asked about the now-removed function of exporting Reports to Excel. I was told that there's no way to do so in Access 2007 and that the best best would be to export the underlying Query.

I did so and I found out that the query was showing the record number of some data pulled in via combo box (which gets data from a separate table) instead of the data itself. Logically, I can understand why that would happen, but is there a way to change that so that the intended data, not the record number, is shown?

Currently:

2008.....spring.....45.....33.....222.....bookname .....bookauthor.....edition

Preferred:

2008.....spring.....johnson.....aspen publishing.....Intro to Criminology.....bookname.....bookauthor

Once this is sorted out, I can automate the export without a problem. ;)

View 3 Replies View Related

Negative Numbers In Query Are Not Sortin Correctly.

Sep 26, 2007

I have a table with data that is similar to this:
HCP1 DATE (Fields)
-.1 7/19/2007
-.2 6/14/2007
0 9/9/2007
1.2 4/23/2006
-.3 4/4/2007
2.4 3/7/2007
0 2/5/2006
1.1 2/6/2007

Etc. There are 0's, negative numbers and postive numbers. Some with at least one decimal point. I am trying to sort the data by the highest number in HCP1 field. When I run the query in Access it looks great. But when run through ASP on the server it is only giving me the negative numbers, no 0's no positve numbers. It would return -.1 in this sample data as the first record.

Anyone know what might be going wrong on the server side of things. The query statement looks the same on both sides. (server and access)

Thanks for any help.

View 5 Replies View Related

Reports :: Report That Takes Numbers From A Query

Nov 25, 2013

I have a report that takes numbers from a query

as an example

To be migrated - 50
Migrated - 30
Excluded 10

were each number comes from a query field..Can I add say Migrated and Excluded within the report and possibly other calculations that I may wish to include.

View 3 Replies View Related

Queries :: Subtracting Stock Numbers With A Query

Jan 2, 2015

I'm creating a sales system that allows customers to place orders using a customer account. when a customer completes an order the number items in the order needs to be subtracted from the stock numbers of each of those items stored in the system.

What I have so far is zipped and attached,

The way my system works should be easy enough to understand, there are four linked tables that store information on customers, products and orders. What I'm really struggling to understand is how to take the values in the records in the Invoice-Product table and take them away from the stock numbers for the products in the products table. But only new orders should take away from the stock number when a new order is placed.

If possible I also need to be able to add stock numbers for example if a delivery comes in, and if it's similar enough could that also be done here?

View 4 Replies View Related

Discrepant Record Numbers Between Query And Table It Is Based On.

May 25, 2007

I have a temporary table with all text fields for importing data to a normalized table. In order to import I need to prep the data by pulling the numeric values of "lookup" type fields (nb. not actually using MS Access lookups)

My prep query is producing 9 more records than there is rows in the import table, even though every join is a LEFT join, which should just pull all import rows and match up lookup values where they are available.

eg. of import table (all fields are text)

Location;
Group;
Name;
Wfm type;
Account Number;
WFM Status;
Date Created;
Date Held To;
processdate

Beachville Operating Centre;
Service Orders;
DAVID JONES;
;
Complete Engineering Investigation;
Completed;
4/20/2007;
;
4/27/2007

here is my prep query (the iif is to replace userid's that can't be found with UNKNOWN)

SELECT lookup_location.val AS F1location, lookup_group.val AS F2group, IIf([lookup_user.val] Is Not Null,[lookup_user.val],"UNKNOWN") AS F3user, wfm.wfmcode AS F4wfmcode, CURPW020_import.[Account Number] AS F5account, lookup_status.val AS F6status, CURPW020_import.[Date Created] AS F7datecreated, CURPW020_import.[Date Held To] AS F8dateheldto, CURPW020_import.processdate AS F9processdate
FROM ((((CURPW020_import LEFT JOIN lookup_location ON CURPW020_import.Location = lookup_location.txt) LEFT JOIN lookup_group ON CURPW020_import.Group = lookup_group.txt) LEFT JOIN lookup_user ON CURPW020_import.Name = lookup_user.txt) LEFT JOIN wfm ON CURPW020_import.[Wfm type] = wfm.wfmname) LEFT JOIN lookup_status ON CURPW020_import.[WFM Status] = lookup_status.txt;

any assistance would be much appreciated. any other info needed let me know.

View 3 Replies View Related

Queries :: Function To Output Line Numbers In A Query - YTD

Apr 18, 2014

Is there a built in function which can be used to create line numbers in a query?

I've written a query to calculate year to date (YTD) points for yachts in a series of races and sorted it in descending order - so yacht 1 is coming first, yacht 2 is coming second etc. I'm looking for a way to add sequential numbering (starting at one and increasing by one for each line) into the query to represent their YTD places. Or this this something that should be left to the report which uses the query?

View 1 Replies View Related

Queries :: Simple Query To Find Records Which Are Not Numbers

Jun 1, 2015

I have an table that contains StudentID, Name and Age. I have imported the data from Excel sheet and there are some records which contains Null Value and some "h", "n/a" etc. I would like to design query which finds the records that are non numeric.

View 2 Replies View Related

General :: Query Criteria - Data In Fields Are Numbers

Nov 7, 2014

I have a query criteria where the data in the query field are numbers.

The following works as long as I have a value in the textbox otherwise I get an error message stating, this expression is typed incorrectly.

Code:
Like [FORMS]![FONMain]![txtTest15] Or [FORMS]![FONMain]![txtTest15] Is Null

Also tried

Code:
[FORMS]![FONMain]![txtTest15] Or [FORMS]![FONMain]![txtTest15] Is Null

Yet I use the following script for another column which has identical data and it works fine either way and I can use it in the other column and it works with or without data in the textbox

Code:
Like [Forms]![FONMain]![txtFact1] Or [Forms]![FONMain]![txtFact2]
Or [Forms]![FONMain]![txtFact3] Or [Forms]![FONMain]![txtFact4] Or [Forms]![FONMain]![txtFact5]
Or [Forms]![FONMain]![txtFact6] Or [Forms]![FONMain]![txtFact7] Or [Forms]![FONMain]![txtFact8]

[Code] .....

View 5 Replies View Related

Queries :: Using Query To Extract Data Based On Numbers

Feb 18, 2014

I have a table with a field named BinNo which has a list of items with a bin no in the format 1.234( this number can be any number up to 6000.9999).

Is there a way for me to have a field on a form where I enter a number (i.e 1) and it lists all the items with a 1 before the decimal point but not 10 or an other number with a one in it. If I enter 10 then it will only give me the items with 10 before the decimal point and not 11 etc.

I have a query that pulls all the data into it but I only want the query to show the items relating to the number I enter into the form field.

View 2 Replies View Related

Forms :: Retrieve Info From Another Query - Higher Column Numbers?

Aug 22, 2014

When I attempt to use the me.field = me.combobox.column() method to retrieve info from another query,it only works if I use column 0 or 1... it doesn't work with higher columns number.

- field name: cbofi
- row source: listado-unico-fi <-- it is a query with unique values and 7 fields in total
- event procedure, change:

Private Sub cbofi_Change()
Me.txtDOCTPT = Me.cboFI.Column(1)
Me.campovia = Me.cboFI.Column(5)
End Sub

- txtDOCTPT is the field that indeed works
- campovia is the one that does not work

I tried using column(0) and column(1) and it worked fine... but higher column numbers do not work. Just mentioning because the field names are all right.

View 3 Replies View Related

Forms :: Unbound Combo Box - Lookup List Of Numbers Through Query

Oct 2, 2013

I have an unbound combo box that looks up a list of numbers through a query but on the drop down list it does not go all the way down to the bottom of the numbers. For instance the combo box will only go down to the number 27453 but I know there are more numbers than that in the table. I can even type in a number and get the info but it still doesn't show up in the list...

View 1 Replies View Related

Access Not Recognizing Numbers After Run Update Query To Revise Values In One Column

Oct 25, 2014

Access doesn't seem to recognize the values in a table I am updating. I am using an update query to revise prices in a column Titled "Price". I am comparing the prices in the Price column to the prices in another column with a simple IIF statement (i.e., IIF([Price]=[Column2Price],"Yes","No"). However, oddly, the formula produces a "No" result, even when the prices are plainly the same values, and all formatting for both columns is the same. Whenever I manually type over the price with the same value, the formula works and Access seems to work as intended. For example, I simply type "12.95" over the same value that is displaying in the column that I updated that is already showing "12.95". Then, after I do that, the formula works and produces a "Yes" value.

View 3 Replies View Related







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