Queries :: Getting Information From One Field To Two Fields
Dec 20, 2014
I have a table that contains Investigator1,Investigator2 and other fields
And another table that contains PID, Rank_Name_Family and other fields
I am making a query in that query i want to get the names of Investigator1 and Investigator2
Investigator1 and Investigator2 is the PID
for example
Investigator1 = 1
Investigator2 = 2
PID = 1 Rank_Name_Family= Roy Jalbout
PID = 2 Rank_Name_Family= Rony Jalbout
i tried this two solutions but the result is error
Solution 1
Code:
Name1: DLookUp([Rank_Name_Family];"tbl_Personal_Information";[tbl_Personal_Information].[PID]=[tbl_Driving_Expert].[Investigator1])
Name2: DLookUp([Rank_Name_Family];"tbl_Personal_Information";[tbl_Personal_Information].[PID]=[tbl_Driving_Expert].[Investigator2])
Solution 2
Code:
Name1: DLookUp([Rank_Name_Family];"tbl_Personal_Information";[tbl_Personal_Information].[PID]=[Investigator1])
Name2: DLookUp([Rank_Name_Family];"tbl_Personal_Information";[tbl_Personal_Information].[PID]=[Investigator2])
View Replies
ADVERTISEMENT
Jan 21, 2014
I need to know a query to pull information from two date fields into one. I have a BuriedStartDate field and an AerialStartDate field. In a third field I have PlacementStart. I would like to put the date into the PlacementStart field which ever is the oldest date bewtween the BuriedStartDate and AerialStartDate. It has been awhile since I have done any queries on Access 2007. I am completely self taught in Access.
View 2 Replies
View Related
Apr 16, 2012
I have a database in which we are trying to have a field "Headcount" automatically fill with the correct value based on information in multiple fields. The "Headcount" field will be based on about 6 or 7 rules. Most of the rules i can figure out, but im having trouble figuring out what the best way would be to search for a single individual's projects when they are on more than one project at a time. I thought about using a counter of sorts to count how many projects someone was one, but how do I pick them out of the entire table once i have found out the number of projects? Would a for loop work best or just many if statements?
View 5 Replies
View Related
Jul 29, 2013
I have a DB to keep track of my employees. I have one table with named EmployeeT with the basic information like name, address, phone number, etc. And another table named EmployeeHistoryT which tell me about there hisorty in the company, basically, If they were Late, did not show up, cancelled from that day. They share a relationship threw the employee ID. IN the history table, I have DateofAction:, TypeOfAction:, and Description:. In the type of action area I have it set to were you type in what they did, wether it be Late, Did not Show up, Cancelled, etc. I want to be able to get a total about of Late, Cancels, etc. I want to know that John Smith was Late 16 times, cancelled 10 times, and Did not show up 2 times. Is this possible with only one feild.
View 6 Replies
View Related
Aug 7, 2014
How I can retrieve the following information from a field
[CONTENTS]
1 x 17.7ml
2 x 17ml
1 x 181.1ml
I need
17.7
17
181.1
I was using a combination of CAST(LEFT(RIGHT...)) AS Float
but that obviously won't work due to too many variations...
View 4 Replies
View Related
Apr 2, 2014
I have a record that has a field called "PG". Every "PG" has different standards depending on what quarter it is in. There is a field called "Quarter" in the record along with a field called "PC". The "PC" field is the "PG" field plus the "Quarter" field. (all are text fields). I would like the "PC" field to be automatically entered once the other 2 fields have their values. Do I use the formula
[PC] = [PG] + [Quarter]
And do I put that as an event, and if so, which one.
View 4 Replies
View Related
Jul 22, 2013
The database needs to have columns for 17 individual connectors. These fields are populated from another table containing all of the possible connectors that could be used and a description of them. I need to set up a query that contains the 17 connector fields as well a field with the description of each connector. Is it possible to have this query auto populate the description fields from the table that contains the connectors. I have attached a picture below.... Each pin has a label that has to be manually filled and a pin name that has to be chosen from another table. I want to have the pin description fields auto populate to match the selected pin names.
View 4 Replies
View Related
Sep 20, 2007
Morning everyone
I have made up a database to record generations of birds; along with others I have the following fields:
Ring number (primary key)
Sex
Year
Colour
Data entry via a form view.
For new entries I pick up from a combo box the parents, what I need to do now is create a relationship between 1, 3&4 and 2, 5&6 so that the data will automatically slot in the relevant fields.
1Parent Cock
2Parent Hen
3Grand Parent Cock C/S
4Grand Parent Hen C/S
5Grand Parent Cock H/S
6Grand Parent Hen H/S
would I do it via a query.’ And would one cover relevant generations
Thanks for any help
Norma
View 8 Replies
View Related
Jan 17, 2006
Hi, I was wondering if anyone could help me.
I have a simple database, consisting of two tables and one form. I'd like the form to display information mainly from the first table (table 1). For this, I have used the Form Wizard, which works well and displays as it should. My problem comes when trying to display data from table 2, without using the Form Wizard.
I have a simple field called 'Number' in 'Table 2'. I'd like this value displayed in a text box along with table 1's data. I've tried using the expression builder, which gives me something along the lines of:
[tbl_Table 2]![Number]
But this is displayed as:
#NAME
...when I open the form. Could anyone explain how I do this correctly please? All I'm trying to do is display data from other tables in the form.
Any help is much appreciated.
View 5 Replies
View Related
Feb 6, 2015
I have a table which now contains a couple of hundred records with more than thirty fields each, and will ultimately contain over 1000 records. Some of these fields use the multiple value feature, and the fields and the forms which fill them work beautifully. Now comes the challenge.
Without going into detail that I'm not at liberty to share, I can say that there are different offices which have different people who are responsible in different ways for the work covered in these records. It is possible for each record to have multiple people assigned to it from the same office. This requires setting the control that shows the people from each office to allow multiple values. I need to be able to create a report which will allow me to hand a list of all the records each person is responsible for in the office to the person responsible, in spite of the fact that this will mean records will show up on more than one person's report.
Before I knew that there might be multiple people in the office for each record, I created great reports grouping and ordering by this office's control and field. Now, since they allow and store multiple values, I can't use them any more. I need to be able, as I said above, to get the same effect. I think the answer lies in some sort of calculated field or formula that applies text filters. What I need to be able to do is look in the field for this office and see if a person's name is contained in the field for that particular record, regardless of who else might be in the field, too. I need to be able to use the results from this filter or calculation or formula to generate something I can use in the group and order by processes.
View 7 Replies
View Related
Dec 20, 2013
I have attached a portion of my database. if you go into the form called frmtest, select a branch from the very top drop down, select a detail and click the Edit button.how to have the information populate all the fields for editing. The Cost and Quantity fields work but my combo box fields don't properly work. The top combo box populates but when the record is updated it doesn't save the id. The second combo box doesn't even put the data in the data box.The main table where IDs and fields are is the BRANCH_EXP table, it's a linking table which links tables with many to many realationships.
View 3 Replies
View Related
May 15, 2015
I have a table which has each claim as a single record. A client wishes us to provide the data in a format that lists the each procedure on its own line. I have attached a highlevel example of what the data currently looks like and what the query results should look like.So I need to create a query that would repeat the Claim Number and place all the Procedure fields into one field.
View 1 Replies
View Related
Feb 24, 2015
I have two tables: tbltasks & tblsafety
Both tables have a date field in, one table keeps tracks of my tasks the other the expiry date of some safety checks.
I currently have a timed pop up that looks at dates within a table that are within 30 days from now, if there are any dates the reminder pops up.
The problem is I want the pop up to look at two sepearte columns in two different tables, so I figured it would be easier to create a query combining these dates and just ask the pop up to look at that query date column.
I want to create a query that very simply lists all the dates in one column combined from both tables.
View 3 Replies
View Related
Oct 11, 2013
I need to do a query to find a field value from similar fields. Table 1 has fields(customer id,...) and table 2 has fields (customer id, address,...). I need to use customer id from table 1 to find address in table 2. Both customer id fields in both tables is the same.
View 4 Replies
View Related
May 13, 2013
I have a couple of fields in Access. To explain I will show here the fields I have and their datatype
ID: Autonummer
Amendment: Text
Basis info: Yes/No
Sex: Yes/No
Period: Yes/No
Salary:Yes/No
Shift:Yes/No
Now, in the amendment field, I've inserted a combo box, with 3 options in it. Let's say option A,B and C...The thing I want access to do, is, when option C is selected, I want fields Period, Salary and Shift to be automatically "Yes".But if option A or B is selected, the the user must choose what the other fields are going to be either Yes or No
View 8 Replies
View Related
Aug 4, 2014
I have a query based on a query, when I added a new field to the base query, this field did not appear in the list of fields in the design definition when I try and add to the upper query. It just shows the original fields only.
Same thing happened in a field on a report - I had to delete the field and create it again...
View 4 Replies
View Related
Jan 18, 2015
I have the query below that return a table like:
PLOTNR; period,Value, ID, Basal_area/ha, Basal_area/ha, perc_BA_sp
What I want to is to add another field that rank the perc_BA_sp by PLOTNR descending (thus highest perc_BA_sp values rank one etc.)
Code:
SELECT[Q:INV1-Basal_area_plot-spp].PLOTNR,
1 AS period,
[Q:INV1-Basal_area_plot-spp].Value,
[Q:INV1-Basal_area_plot-spp].ID,
[Q:INV1-Basal_area_plot-spp].[Basal_area/ha],
[Q:INV1-Basal_area_plot].[Basal_area/ha],
([Q:INV1-Basal_area_plot-spp]![Basal_area/ha]/[Q:INV1-Basal_area_plot]![Basal_area/ha])*100 AS perc_BA_spFROM[Q:INV1-Basal_area_plot-spp]
[code]....
View 1 Replies
View Related
Jun 4, 2013
How to query Select Distinct field + showing other fields? E.g.:
Code:
SELECT DISTINCTROW assetMovementTable.assetNo, assetMovementTable.moveCode, assetMovementTable.compCode, assetMovementTable.compCodeDesc, assetMovementTable.assetDesc, assetMovementTable.equipType, assetMovementTable.equipManufacturer, assetMovementTable.equipModel, assetMovementTable.constYear, assetMovementTable.plateNo
FROM assetMovementTable
[Code] ......
View 7 Replies
View Related
Jun 9, 2015
way to merge various fields from a table into just one using a query.The purpose will be for easier copying and pasting in to an email.So we have a table to stores information such as Site Contact, Address 1, Address 2, Address 3, Postcode etc.
I want to be able to run a query that will put the address in to just one box, either in the query or on a report then it's much easier to just highlight the full address and copy and paste it into an email. Rather than copying each field individually.
View 3 Replies
View Related
Nov 28, 2014
I have one field called FULL_ADDRESS. From that field I am going to populate two other fields. One called ADD_1 and the other, ADD_2.
In the FULL_ADDRESS field I have the following text :
"BOX 2747 ROCKY MOUNTAIN HOUSE AB T4T 1L7"
I want ADD_1 updated to:
"BOX 2747 ROCKY MOUNTAIN HOUSE AB"
and ADD_2 updated to:
"T4T 1L7"
While I understand how to do an update if I was using a space as a reference, i.e.
Trim(Left([FULL_ADDRESS],Instrrev([FULL_ADDRESS]," ")-1))
Trim(Mid([FULL_ADDRESS],Instrrev([A]," ")+1))
I can't figure out how to skip the first space from the right, and reference to the second occurring space, so that I get "T4T 1L7" to populate the ADD_2 field, and everything to the left of "T4T 1L7" placed in the ADD_1 field.
View 6 Replies
View Related
May 23, 2013
I'm having trouble with using a where statement linked to fields when the field is empty. I need a way to say if field is null then 'do nothing'/'select all' else use the text from the box.
I have a form (ServicesRCSSearch) which has 3 combo boxes (Location1, Location2 and Location3). These fields are linked to a query. The button on the form generates the query.
My SQL for the query is currently:
Select Services.Key, Services.Location, Services_1.Location, Services_2.Location
From Services, Services_1, Services_2 (copies of the same table all left joined)
Where
((IIf(forms!ServicesRCSSearch!Location1 Is Null,"",services.Location=forms!ServicesRCSSearch! Location1))<>False)
And ((Services_1.Location)=IIf(forms!ServicesRCSSearch !Location2 Is Null,forms!ServicesRCSSearch!Location1,forms!Servi cesRCSSearch!Location2))
And ((Services_2.Location)=IIf(forms!ServicesRCSSearch !Location3 Is Null,forms!ServicesRCSSearch!Location1,forms!Servi cesRCSSearch!Location3))
This works in that it uses the fields to filter the query but when Location1 is empty there are no results as you can see from the code.
View 6 Replies
View Related
Jul 26, 2012
I have a form to record student information. On my student table i have a school I.D that links to the primary key of my school table.
My problem is that in my form, i want to be able to fill in the rest of the fields about the school info based on the I.D chosen.
i.e.
student table:
Student id
name
address
school I.D (FK)
School info table:
School I.D (PK)
school name
contact name
email
address
My form that's linked to the student table needs all the information from the school info table in separate fields
but i can only select School I.D in the Control Source Property.
View 1 Replies
View Related
Jun 3, 2013
I have a field called uniqueID which I would like to update based on 2 other fields that are already populated in my recordset (from running previous queries). I heard it is not possible to do an Update Select like shown below.
select max(uniqueID) from myTable where a = "value of field a from first record in record set" and b = "value of field b from first record in record set"
If it is true that I cannot do an Update Select then I am trying to do something in VBA. How can I Loop each row in the record set and store the values from fields a and b. I would obviously then need to pass those values into the sql above and store the result in a variable. I would then do a straight update to put the value of uniqueID into myTable.
View 1 Replies
View Related
May 22, 2013
Access 2010. I've had to learn it at work because our DBA was let go and I was the only one willing to give it a go. Read a book or two and picked up some stuff on the internet.
Here's my problem:
I have a simple table -Employee with 4 fields. FirstName, LastName, Office and JobTitle. I have form called Form1 that has 3 control fields cboJobTitle (a combo box that is populated by a query that finds all the unique values of that field in the Employee table), cboOffice (same as above) and txtName (a text box to allow user input) that are used as the criteria for a multi-field query triggered by a button at the bottom of the form. The idea being that you could do a search using this form to find all the employees in one office or all the accountants in one office, or any other combination.
The main search query has the following criteria for each field -
Like [forms]![Form1]![cboOffice] & "*"
Like [forms]![Form1]![cboJobTitle] & "*"
Like [forms]![Form1]![txtName] & "*"
It works great...until I enter a record where one of those fields may be null, such as if I leave the JobTitle blank.
If I have two employees in an office in one city and then do a search for all the employees in that office, it only returns one record and ignores the one that has the null value in the JobTitle field.
View 14 Replies
View Related
Nov 2, 2014
I have a client database that has recently had multiple duplicate entries. I need to reduce or negate this erroneous activity. I have a client table where I record amongst others, the following;
key
[christian_name]
[family_name]
[dob]
......
I believe that to prevent duplicate entrie via form I have created an additional field called "unique" given it as a unique index which I want to have populated with the joined fields first_name & last_name & dob (IE johndoe01/01/90), and then as user enters a new client it wont allow a duplicate.
However I need to fill all the existing customers (3600+) with the relevant joined existing data. If I create an expression I can cajoin the fields in a select query but when I try to make an update query the same syntax comes up with empty fields.
select query sql that worked to show field ...
SELECT divers.christian_name, divers.family_name, divers.dob, [christian_name] & [family_name] & [dob] AS Expr1
FROM divers;
update query that was empty ..
UPDATE divers SET divers.[unique] = [christian_name] & [family_name] & [dob];
View 4 Replies
View Related
Nov 5, 2014
I have a form (form1) that will populate with records (table1) based on key fields of "Project Number" and at time-points we will update part of the record, and then we create a word document detailing the updates with a couple of other bits of information not in original record.
Basically I want it to go from the original form (form1) into another form (form2) (via a command button) taking the key field of "Project Number" where it will ask the bits of information that we don't need have already and the contact person.
I have got this to store in a different table (table2) using a key field of just "ID" from the original records (table1). A list of contact people are in a separate table (table3) using a key field of "contact name" which will include other details for them such as address and phone number.
So from "form2" I would like to produce a report that contains information form "table1" based on the "Project Number" and "table2" based on "ID" as just been generated and "table 3" which is based on "contact name".
So I want to pull information form the records based on the certain key fields but struggling for it to pull it successfully...
Got relationships between:
"contact name" fields in both "table2" and "table3"
"project number" fields in both "table1" and table2"
In a query for the report I have all the appropriate fields, but only have the "contact name" and "project number" from "table2" is this right? or do I need both in?
Or would it be easier to draw all this information into "form2" but don't really want to select that many drop down boxes or would it be able to pull it from the "contact name" and "project number" boxes????
View 6 Replies
View Related