General :: How To Divide 1 Record In Multiple Records

Nov 12, 2013

I have an order table

order nr quantity.
100 110

and a pack table

pack quantity
1 1
1 2
...
1 25
2 1...

I want to make a query that returns this :

order nr pack quantity
100 1 25
100 2 25
100 3 25
100 4 25
100 5 10

View Replies


ADVERTISEMENT

Queries :: Put Sum Of All Records In Calculated Field And Divide It By Predefined Value

Feb 6, 2014

I want to take the sum of all records 'cost' i.e.
record 1 - 2
record 2 - 4
record 3 - 3

I want to take the sum and put it in a calculated field and use it to divide it by a predefined value 'no of responses.'

So I make the field in the query -> Calcfield: (Sum([cost])/[responses])

I am pretty new to this and i don't understand why this won't work? Is it something to do with the row Group by (total.)

View 3 Replies View Related

General :: Divide Groups By Equal Distribution Of Merit / Talent?

Aug 9, 2013

I am with an educational organisation. Now we need to allocate various fields to students depending upon their merit, where the difference between the average percentages between any two groups cannot be more than 2% and that also implies equal distribution of talent. However, First few have to be given choice of field and also students recommended have to be given choice. The number of fields varies from 2 to 8. . Further the vacancies are also not equal in all fields. E.g. for 100 students to be divided in four fields the vacancies can be 35 for ZZSS, 24 for UYTE, 29 for OIUI and 12 for HGFT.

I need a solution preferably in MS Excel or MS access for the same with nil/ least usage of VBA.

Table examples

Name REg. No. Percentage

Aaa 986544a 89.3%

Bbb 547521j 87.2%

Ddae v44887y 95%

View 8 Replies View Related

DLookUp To Divide A Field In One Record By The Same Field In Another Record

Dec 13, 2006

I'm fairly new to setting up Access databases. Been learning a lot. Ran into a snag that I'm hoping you can help me with.

I am using a form to display text labels and running statistics for our jail.

The form, "Complete_Worksheet" gets its data from a query, "qryComplete_Worksheet". Fields that make these up are:

ID (key)
Standard (text)
Outcome Measure (text)
Numerator/Denominator (text)
CalcValue (number)

ID, Standard, Outcome Measure, and Numerator/Denominator are queried from a table, "tblComplete_Worksheet". CalcValue comes from another query, "qryDataSelect". My problem is this:

In the final calculated statistic, some records are numerators and some are denominators. I need one more field, which I have been trying to create as a calculated control on my form which will divide each numerator CalcValue value by the denominator CalcValue value following it. Since these values change constantly as new data is entered into another data table, the calculated control needs to also change with them. I have been attempting to do this using the following expression:

=DLookUp("[CalcValue]","Complete_Worksheet", "[ID]="&"[ID]-1"/[ID]=")

I keep getting a #Error message in the control in form view. When I run the expression in the Immediate window, I get a Compile Error:

Expected: line number or label or statement or end of statement

Any suggestions on how to make this work?

View 9 Replies View Related

General :: Create Multiple Records From One

Jun 19, 2012

I have three tables:

tblClient (for basic client information),
tblDischarge (for client discharge information), and
tblAppointments (for appointments that are added to an outlook calender).

All three tables are linked using the IDNumber from the Client table. I have a form where a user inputs a discharge date for the client.

Once that date has been added I need to add 5 records to the Appointments table for different followup times based on that discharge date (such as one month, two months, three months, etc.).

I have the code working to add an individual appointment to outlook but not 5 different ones at one time. So the question I have is how to add the 5 records based on the one discharge date?

View 1 Replies View Related

General :: How To Save Multiple Records In One Go

Sep 25, 2012

I am using access around after 15 year, now I am trying to build small database for my budget purpose

Here is the situation example:

FY2013 = Total working days
Period 1 = No of working days & expected Exchange rate
Period 2 = No of working days & expected Exchange rate
so on........
Period 12 = No of working days & expected Exchange rate

Now once i done - I want to save all record in single go, plus since this budget - total working days can't be change therefore, to avoid any error made by someone, i would like to save Total working days = (Period 1 ++++++++ Period 12)

View 1 Replies View Related

Split One Record Into Multiple Records?

Mar 14, 2013

I have a client who has data like this in an access table:

itemID
itemName
itemQuantity

1
Corvette
1

2
Mustang
2

3
Camaro
5

He wants to append the data to another table so it looks like this:

itemID
itemName
itemQuantity

1
Corvette
1

2
Mustang
1

2
Mustang
1

3
Camaro
1

[code]....

View 1 Replies View Related

General :: Add And Update Multiple Records To Different Tables

Jan 12, 2013

I have a pretty normalized Access Database. The table that I am trying to add new records is tbl_returns and has 4 fields: return_ID, serial, reason and inv_num.

When I sell a card (or a range of the cards) an invoice including all the information is saved as a record in a new row in tbl_invoices.

If a vendor wanted to return a card (or a range of the cards) in the next visit (weeks or months later) I will accept and in most cases they want me to switch the cards with new ones. Therefore in a new invoice (different date and invoice number) I will give him new cards and return the cards that he wanted to change or return.

Now I have to assign NULL to the inv_ID field in tbl_allPins in order to make it available for sell in future. At the same time I want to have a record of the returned cards including serial number , the reasoning of return, invoice number and/or a little note about each one/range of the card(s).These are to be recorded in tbl_returns as you can see.

For instance you want to return serial numbers between 9876 and 9880 (includes 5 cards) because of the "scratch off problems" and your invoice number is 22222, using frm_returns. After you process it and then open the tbl_returns to check the result, you will see 6 records are added instead of 5. I was able to understand why it is happening (I believe so!) but I could not fix it. Also I cold not write a VBA to remove the inv_ID in front of the related serial numbers in tbl_allPins.

Also in another trial was ended up to creating the Form1. Form1 looks better (has no extra records) but I have trouble to navigate through the records in tbl_returns. There was a sub-form added but it was showing all the records in tbl_returns which is unwanted.

By the way, serial numbers and PIN numbers are each a unique number in tbl_allPins.

View 3 Replies View Related

General :: Creating Multiple Records (with Queries)

Jul 19, 2012

I'm working on a contact database for my company's sales efforts. It tracks interactions with prospective customers and assigns them to employees here. My question is this: For mass contact efforts (such as mailings), is there a way to create mass entries to my "Interactions" table so that no one has to enter a mailout interaction 1000+ times?

Structure of the relevant bits of the database is as follows:

Contacts Table
Interaction Table

Contacts Table is linked with Interaction table via ContactID

Queries are run to narrow Contacts by various criteria (ex.: by the employee they're assigned to).

So if I run a query to get all the contacts assigned to me, and there are 450 of them, and I send a mailout to all of them, and I want to add an interaction to those 450 people, is there an automated way to do this?

View 5 Replies View Related

General :: Adding Record To Multiple Tables

Jun 6, 2013

I have a main table with subject id and other fields. I also have 16 other tables which have questionnaire information at 17 different timepoints. In those tables, the subject id is the only connected field between the main table and 17 different years. When I add a new record (by subject id) on the main table, I want it to add that same subject id to the 17 other tables because that subject id will eventually get all 17 years worth of data. But even using subforms, it will not add a new subject to the other tables unless I add some sort of information such as (date received) into the subform.

View 6 Replies View Related

Consolidating Fields From Multiple Records Into One Record

Nov 29, 2012

In Access 2010, I have a table with two fields. The first field (Investor Name) contains several occurrences of the same text (i.e. Investor A occurs 2 times, Investor B occurs 3 times, etc.). The second field (Investment) may or may not contain duplicates (i.e. more than one Investor may have invested in the same Investment). I'm trying to create a query that will show me, in one record, all the Investments that each Investor has made.

So for the following data...

Investor Name
Investment

Investor A
Investment 1

Investor A
Investment 2

Investor B
Investment 1

Investor B
Investment 3

Investor B
Investment 4

I want the query to report back the following...

Investor Name
1st Investment
2nd Investment
3rd Investment

Investor A
Investment 1
Investment 2

Investor B
Investment 1
Investment 3
Investment 4

To clarify further, I'm NOT looking to concatenate the results into one field. Instead, I want each Investment to appear in its own field, so that I can pull each one into a report later. Ideally, there should be no limit to the number of Investments that each Investor has made, although practically speaking, it likely won't exceed 10 or so.

View 14 Replies View Related

General :: How To Filter Records Using Multiple Combo Boxes

Jun 29, 2014

I have a table with the following 5 fields. (Service Type), (Valve Name),(Size),(Rating),(Description).

I want to do two thing:

First: I want to select the required information from the first 4 fields using combo boxes and get the last field (description) based on the selected 4 fields. In other words, i want the record to be filtered using first 4 fields to give me the last field info.

Second: I want to store the filtered record (all 5 fields) in another table.

View 6 Replies View Related

General :: Using One Entry To Create A Record In Multiple Tables?

Oct 21, 2012

I'm pretty new to making databases outside of a basic access class..Is it possible to make a record in one table that makes a new record in 5 different tables using different bits of the initial record?I want to use the data entered in an evaluation form to create a new entry with the basic identifying information in 4 different tables.

View 12 Replies View Related

General :: Find Records That Match Criteria Of Multiple Fields

Mar 12, 2013

Using sql or access query I would like to create an expression that aggregates the first field and I would like to see all records grouped by the relationship with another field. Let me show an example.

My query shows:

field1 field2
apple a
apple b
banana a
carrot a
carrot b
dog b
elephant b

I would like my query to now display a third field and group field :

field1 field3
apple both
banana a
carrot both
dog b
elephant b

View 1 Replies View Related

General :: Search Records Based On Multiple Check Boxes?

Jan 3, 2013

I have a table of data regarding companies (contact info, etc). The company I work for provides these companies with up to 10 different products. On my input form, I have created 10 check boxes (and thus, 10 columns of Yes/No data in the corresponding table).

Each company has at least 1 product checked off, and up to all 10.

I would like to create a combo box that lists all 10 products, and upon selecting one, a list box then populates with the names of the companies (primary key) that use that specific product.

So, for example,

Company A buys CATS and DOGS from us
Company B buys DOGS
Company C buys CATS and ELEPHANTS
Combo box options: CATS, DOGS, ELEPHANTS

If I choose DOGS, then a list box gets populated with:

Company A
Company B

and when I click either of these, the record should be brought up for the respective company.

All of this should take place in the header of the form, while the form itself can be updated based on search selections.

View 3 Replies View Related

Excluding Multiple Records From Query Based On Value In ONE Record

Sep 27, 2005

Table1 gives Case Nu.

Table2 gives Case Nu. and EventType.

Table3 gives EventType and Cleared (yes/no field)

I want to run a query that gives Case Nu and Event where if there is even one event marked Cleared for a Case, then that case number and its events (even those not marked cleared) don't show up at all.

Any ideas? I know there must be an obvious solution, but my mind is stuck right now!

View 2 Replies View Related

Parsing A Record Into Multiple Records By Date Range

Sep 1, 2015

I have a record in a table (Table1) with the following:

Item Start End
A 2012 2030

I have another table (Table2) with the following:

Item Start
A 2018

A 2025

What I would like to do is update/append Table1 so that it looks like the following:

Item Start End
A 2012 2017
A 2018 2024
A 2025 2030

View 4 Replies View Related

General :: Audit Trail - Capture Occurrences When Multiple Records Selected To Be Deleted

Jan 15, 2013

I've always used an audit trail for tracking changes of records that already exist but I have had a situation come up where I now need to track records that have been deleted. For example, if I delete a record in the datasheet view.

I've seen several examples how to do this, with the most common seeming to store the data into a temporary table while waiting for the delete confirmation. If I am reading the notes correctly, it's done this way to capture occurrences when multiple records are selected to be deleted. Is this the best approach for this type of task?

View 1 Replies View Related

Queries :: Query Multiple Records Between (Weeks) Where No Record In Child Table?

Jul 1, 2014

I am trying to determine the best method for how to handle this query using Access 2013. I have a clients table that contains the following:

clientID fName lName admissionDate dischargeDate
1 John Doe 05/06/2014 06/27/2014
2 Jane Doe 04/24/2014 05/15/2014
3 Steven Smith 05/15/2014 NULL/Empty
4 Chris Davis 06/12/2014 NULL/Empty

Then there is a WeeklyProgressNotes table that is there for the person that is responsible for auditing the clients charts. It does not contain the actual weeklyprogressnotes, it only contains a Yes/No field and a date field for the date the weeklyprogressnote was completed. Like below:

noteID completed dateCompleted clientID
1 yes 05/08/2014 1
2 yes 05/14/2014 1
3 yes 04/25/2014 2

I am creating a form that the auditor can open to determine what weeks she needs to check for each client to see if they have their weeklyprogressnotes completed that week. The weeks run Mon - Sun and there will be no record in the WeeklyProgressNotes table if she has not yet checked and confirmed for that week. So the form would basically look like this:

fName lName week completed date clientID(hidden)
John Doe 5/19/14-5/25/14 Checkbox Null 1
John Doe 5/26/14-6/1/14 Checkbox Null 1
John Doe 6/2/14-6/8/14 Checkbox Null 1
John Doe 6/9/14-6/15/14 Checkbox Null 1
John Doe 6/16/14-6/22/14 Checkbox Null 1
John Doe 6/23/14-6/29/14 Checkbox Null 1
Jane Doe 4/28/14-5/4/14 Checkbox Null 2
and so on.......

I have thought about creating an SQL statement to select all of the clients and then creating a function that determines their admission date within the specific week and their discharge date withing the specific week and then create a loop with another SQL statement with a BETWEEN clause for all the weeks and determine if there is an entry in the WeeklyProgressNotes table or not. If not then I would display out the above info. I'm not sure if there is an easier, less search intensive way of doing it. Maybe an SQL query that can cut done on some of the looping.

View 5 Replies View Related

Queries :: Selecting Most Current Record For Item That Has Multiple Records In A Query

Oct 31, 2014

I have a query pulling data from two other queries (qry_Reports and qry_Surveys). Clients may have more than one ReportID, but only one ClientID. I need to query for only the most current ReportID (which is the larger value) for each client to find the surveys for the most recent report. How can I query for only the most recent report for each client based on the highest value of the ReportID per ClientID?

View 11 Replies View Related

General :: How To Make Records Automatically Scroll From One Record To Another

Jun 27, 2012

Is there a way to make records automatically scroll from one record to another?

View 7 Replies View Related

General :: Update Record ID To Another Record ID In Same Table And Update Related Records

Aug 22, 2013

I have a table called tblCompanies. When a company acquires another company, I need a method by which the acquired company's CompanyID (PK) can be updated to the new company's CompanyID (PK). I also need to be able to update all related CompanyIDs (FKs) to the new value in related tables.

In cases in which the new company does not have an existing record, there is no problem: the company name simply gets changed to the new company and the existing CompanyID is maintained. I then use an audit table and Track Changes function to keep track of the company name data and a union query to keep the old names in the selection lists.

The problem is when both companies already have existing records in the table.

So, let's say I have records for Company A and Company B. Company A merges with Company B and Company B is now the main record. What is the best, simplest and easiest way to update the CompanyID (PK) from A to B and change the CompanyID (FK) to the new value in all related tables?

I am envisioning a pop-up form that directs the user to select the new company and then an update query happens behind the scenes... but exactly how does the criteria for the update query get selected and how do all the related tables get updated? My vba skills are pretty basic, will I need extensive coding to do something like this?

View 6 Replies View Related

Forms :: Split Record Quantity To Multiple Records Based On Quantity Per Package

Jun 21, 2013

I have a form for inserting invoices, and on the subform records I have a command button to print the labels, the label would contain the quantity of the product, so, if the quantity is ex. 11000 and package contains 2000 only.

so I have to print 5 labels with quantity 2000 and one label with 1000 qty

what I need to do, is when I click the label cmd button to insert the 6 records required to print the labels to temp table

View 8 Replies View Related

Modules & VBA :: Split Table Record Into Multiple Records / Rows In A New Table

Nov 10, 2014

In a situation where I imported an excel file with so many columns and split them into two temp tables and they are linked using a key.

the data has a fixed part lets say

Field1....Field2.....Filed3.....Field4...then Field5.....Field6.....Field7....Field8 is the same data range as Field9...Field10...Field11...Field12. I would want to split this data into multiple rows like this

Field 1 Field2 Field3 Field4 Field5 Field6 Field7 Field8
Field 1 Field2 Field3 Field4 Field9 field10 field11 field12 and so own...

What is the best approach?

View 3 Replies View Related

Modules & VBA :: Generate Multiple Records In One Table From Single Record In Another Table

Sep 20, 2014

I am building a simplified re-order point system - if inventory position drops below a certain level (the yellow level is this case) one or more purchase order lines has to be created in another table.

I have one table with the following field and data:

ItemId Red Yellow Green Multiple Inventory position
0001 10 30 50 5 45
0002 5 40 47 5 23
0003 11 20 30 10 5

I would like to generate new records (in another table) based on the above fields and three records.Basically the end result should look as the following:

ItemId Qty Start inv Aggregated inventory Prioritization
0002 5 23 28 Yellow
0002 5 28 33 Yellow
0002 5 33 38 Yellow
0002 5 38 43 Green
0002 5 43 48 Green
0003 10 5 15 Red
0003 10 15 25 Yellow
0003 10 25 35 Green

The logic is quite simple - if inventory position is less than the yellow value new order lines should be created in multiple qty (based on the multiple field) until the aggregated value (in table 2) is above the green value.The priotization value should be based on the start inv (in tbl 2) compared to the values in red, yellow and green in tbl 1.

View 8 Replies View Related

Query - Divide

Mar 13, 2006

Just wondering, if this is possible and if so how?

I got query results and would like to divide a figure from the number of results shown..

so if 4 results are shown from the query then i would like to divide 100 by 4, and if 5 results showed then divide it by 5?

View 5 Replies View Related







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