Losing Records In A Query

Jul 20, 2007

Is it possible to have a query retrieve all information from one table, but only partial information from another?

For example, suppose I have two tables, Jobs and Employees.

The Jobs table is a list of all available jobs in the company; some filled, some not. Each job is assigned a Job Number which is unique.

The Employee table is a list of all employees in that company. Each employee is assigned to a particular job, referenced by the Job Number.

The query's job is to provide a list of all Jobs, but with employee information added to those jobs that are filled.

The Jobs table has two fields; JobNum and JobDesc.
The Employee table has three fields; EmpNum, EmpName, JobNum.

Jobs has five records;

100, Boss
105, Aide
200, Manager
201, Worker
202, Worker

Employee has four records;

111, Montgomery Burns, 100
112, Waylon Smithers, 105
121, Homer Simpson, 201
122, Lenny Leonard, 202

Jobnum is the link between the two tables in the query and its fields are;

JobNum, JobDesc, EmpNum, EmpName

What I want is;

100, Boss, 111, Montgomery Burns
105, Aide, 112, Waylon Smithers
200, Manager
201, Worker, 121, Homer Simpson
202, Worker, 122, Lenny Leonard

But, what I get is;

100, Boss, 111, Montgomery Burns
105, Aide, 112, Waylon Smithers
201, Worker, 121, Homer Simpson
202, Worker, 122, Lenny Leonard

Job Number 200, the Manager slot, is being dropped out.

This is the SQL code for the query;

SELECT Jobs.JobNum, Jobs.JobDesc, Employee.EmpNum, Employee.EmpName
FROM Jobs INNER JOIN Employee ON Jobs.JobNum = Employee.JobNum;

How can I get the complete Job list with employee data added to those jobs which are filled, while leaving the vacant positions - well, vacant, but still included in the query's result?

Thanx!

View Replies


ADVERTISEMENT

Queries :: Select Query Losing Records?

Sep 19, 2013

I have a Union query as follows;

SELECT ALL *
FROM 1st_Lives
UNION SELECT ALL *
FROM 2nd_Lives;

1st Lives has 465,414 records and 2nd Lives has 151,852 records.

When I run the query I only get 604,976 records instead of 617,266 (I basically just want to add the two data items together).

View 1 Replies View Related

Losing Records In Tables

Mar 19, 2012

My company had an Access db created back in 2002 in order to create file names (Legal Labeler). The db consists of many reference tables (Figure 1). The person who created the db created a form to use in order to create the file name and labels. As you can see there are various drop downs where the end user can choose which information to include. I do not think that the tables are linked. Once the end user fills in the form they click Save Label Data and the data is written to a master table (Table tblLevelOneSubject).

One of the problems we are having is that records in any one of the extraneous tables (Company Name, SubCatetory, SubCategories L1/L2, etc.) just disappear. For example, in Figure 3, we have all the entries for the drop down labeled SubCategory (A codes are depicted) but, for some reason, we are randomly missing some of the codes (typically all the A codes and B codes); however, nothing from the master table is missing (that is why I do not believe they are linked).

Another major issue we are running into is in the table named tblLevelFiveSubCatTwo (SubCategory L2 on the form) (Figure 4), which is an auto-numbered table, we are also losing records (as you can see it table starts at 7). When I created a file last week I needed to create a new entry in the drop down SubCategory L2 and it was auto-numbered 8 when it should have been 734. Also, the table shows that there are only 697 records but if we are auto-numbering there should be 734 records. Therefore, we are losing records in this table as well.

Is there any way we can secure the tables so this does not happen in the future? When I export the data into Excel it looks as though all of the data is accounted for - it is just missing in the reference tables.

View 4 Replies View Related

Queries :: Insert Query Losing Decimals

Feb 4, 2014

So, I am inserting new records into a table. The values in the decimals are being stored as zeroes.

Field Properties
Long Integer
Standard (I also tried Currency)
2 Decimal Places

When I remove the "INSERT INTO" part of the query, the decimal data is in the results. I started out not using the FORMAT function. Then I tried it using "Standard", "Currency", and "#,##0.00"

View 3 Replies View Related

Parameter Query With "<=" Losing Values?

May 21, 2007

Any possible solutions to this issue would be much obliged, it's one of two absolutely stupid issues that I'm just working around since I can't resolve...

I have a parameter query set up on a Date/Time field that is returning results not including the last date entered as a parameter. So if the user enters "2007-04-07" for the start date, and "2007-04-30" for the end date, the records with "2007-04-30" are not included.

I know it's some stupid thing I've done with this query that is causing it to do this, but since when does "<= some date" and ">= some date" not include the last date retrieved in the result set... do I need some programming lessons on operators, or what?:confused:

View 7 Replies View Related

Losing Functionality

May 3, 2006

I am building a database for a client that tracks construction drawings. The client came today to check on progress. Just before he came, I changed the start-up properties to hide the database window, menus etc so it would look more like the finished product.

Problem was, I lost alot of the functionality and had to change it back to demonstrate:( . Is this common and can anyone explain why? much appreciated

View 2 Replies View Related

I Keep Losing My Margins

Aug 18, 2006

Hi Everyone

I wonder if anyone can help me please.

I have a form that nearly fills an a4 sheet of paper when printed. For this reason I have to set the margins from 24.99 down to 5.

This is ok and the form works well and prints out properly about 75% of the time. Occasionaly when I open the form it has reverted back to the 24.99 margins which of course prints out on three sheets of paper and is all over the place.

Is ther a way to set the margins on load and can anyone suggest an appropriate bit of code.

Kindest regards

Tony

View 4 Replies View Related

Is It Corrupting Or ? Losing Use Of Buttons

Aug 22, 2007

Hi,

There's not much space in the title but I hope I caught someones attention that can help.

For starters it's ACCESS97

The database is split into front end and linked tables.

We added few fields a couple of days ago. ( We have a full back-up)

What is happening now is that after a period of time the buttons stop working and give a message saying something like...

The On Click can't find the file or info that it is supposed to be doing. That isn't the exact words, but I don't currently have the damaged version it is deleted. There is no error message number.

The same thing has happened 3 times. Each time I delete the front end and replace it with the backed up copy. This then works again.

Also....

Once the corruption or whatever it is happens, you cannot add any buttons in design view and also you cannot get to the Event Proceedures through the properties and also the Build Event doesn't let you in either. All you get whet trying any of these is a File Not Found message.

Any ideas out there or do I just have to revert back to the copy before the changes ?

It's a very big database about 90Meg Front end and 8Meg Tables

Help Please.

Thank you

Mike:confused:

View 5 Replies View Related

Top/Max/Subqueries ... Losing My Mind

Mar 8, 2008

I've looked at so many options for writing this query that I can't see the forest for the trees and hoping you kind folks will point me in the right direction.

I have a table called services that includes:

service_id
prop_id
service_year (ie: 2007, 2008)
service_date (ie: 3/3/08)

service_id is a unique ID for each service which relates to data I will need to pull from another table.

prop_id relates to a property ID in another table, not unique as multiple services against one property.

The problem that I have is that each prop_id can have more than one service_date for the same service_year. I need to be able to find the latest service_date on a prop_id and its associated service_year and service_id.

Any pointers would be greatly appreciated. BTW, using this in Access 2003 & 2007

View 14 Replies View Related

Subform 'losing' Data

May 12, 2006

I have a form and subform. Clicking a record in the subform displays the details of that record in the main form. The form is used for editing, adding and deleting data for a given person's sales record and the subform displays a full list of all records for that person.

When I edit a person's record, using the main form, and click on a button to run the code:

DoCmd.RunCommand acCmdSaveRecord

I can go into the underlying table and see the changes. I can also refresh the subform and see the changes.

However, the next time I click on any of the records in the subform, the value in one of the fields vanishes from both the subform and the table. Any other changes made, to however many fields, remain.

Surely, if there's a problem with that field, the update shouldn't happen at all?

View 3 Replies View Related

Importing A Csv Losing Trailing Spaces

May 26, 2006

Hi,
I am creating a csv in another application where fields may contain trailing spaces. If I open this in excel, the trailing spaces are preserved, but if I import into Access I lose the trailing spaces. Is there any way to preserve them?
Thanks,
Dave.

View 3 Replies View Related

Refresh Subform Without Losing Place

Feb 10, 2005

Hello,

I have a subform that is based on a SQL statement that sums by Dollar Amount and groups by Account. I have it set up so the user can double-click on an account, which opens an unbound form. I then have the form execute a SQL INSERT INTO statement, which works beautifully.

The form opens as a pop-up, and I have it requery the subform when it closes. However, when the pop-up closes, I go back to the first record on the sub-form. I need it to "remember" the record I was on and take me back to that one. What is the standard procedure for doing this?

Thanks in advance!

Eric

View 2 Replies View Related

Losing The Plot With Subform Update!

Nov 16, 2005

right I have a subform which holds assessment data
it is a tab-control form which monthly assessment data each tab has its own form i.e. "frmCurrentAssessment-October2005", "frmCurrentAssessment-November2005" and they are based on their own queries i.e. "qryCurrentAssessment-November2005". It will not let me update the subform which is joined to frmAllStudents which is based on "qryallStudent"

the form and the subforms are joined by Admission Number. I can update directly from "qryCurrentAssessment-November2005". But the form wont let me update, I have already checked that the fields arent locked or that the form isnt uneditable and everything seems fine.

I am at a complete loss as to what to do here, is there something obvious that I havent checked

View 1 Replies View Related

Tables :: Losing Functionality On FE After Splitting

Mar 3, 2015

I've developing a little Project and have some issues after splitting a db.

I have some forms in wich I want to see some tables with the "+" sign on the rows so I can go to their linked tables. The problem that I have is that everything works perfect until I split the access file.

View 5 Replies View Related

Edit Design And Not Losing Data From An Mde File

Jul 14, 2005

Still not sure how to do this, after I convert my database and create an mde file few changes might accrue in the future, I have tried to make some changes for testing purpose and then create a new mde file and saved it with replacing the older one but I had lost my new data which was entered in the old mde file?

Q: how can I make the new change on my original file and not lose my new data in my mde file.

View 3 Replies View Related

Tables :: Getting Rid Of Lookup Fields Without Losing Data

Oct 15, 2012

What is the best way to do this without losing data? I have several FK that I made the mistake of setting up as lookup fields. I now want to correct this without losing data if possible.

DataType currently says "Number" under each of these. So I can't just change them to number. Is there another way to do this?

View 2 Replies View Related

Forms :: Losing Focus After Hitting Enter In Memofield

Jul 5, 2013

I have a form with a memofield (rich text). After hitting enter, a new line is added in, but the focus changes to the top of the memofield (of the same record).

View 6 Replies View Related

Tables :: Consolidating Duplicate Values Without Losing Other Information

Jun 11, 2013

I've got a table which lists accounts with an associated charge. If the account has multiple charges, then the account appears multiple times, for each charge. I'd like to consolidate the duplicates without losing each charge that is associated with the account.

View 4 Replies View Related

Modules & VBA :: Losing Decimal Place In Mail Merge

Sep 4, 2013

My DB is merge in a currency field set to 2 decimal places into word. It's doing this by declaring the fields as variable, calling an instance of work then dropping the values into the bookmarks. All works fine....

When a value is 360.64 is fine, but when it's something that ends with a 0 (360.60) - is loses the 0 giving me 360.6.

View 2 Replies View Related

Tables :: Losing Rows Of Data When Making A Table

May 19, 2014

I have imported 3 different excel worksheets into Access. I then created a query in which I made some relationships and select the fields that I need to make a new table. The problem is, when I run the table the final product is missing about 20,000 rows of data. I have used this protocol successfully for other other files, but for some reason, with this dataset Access is pasting 10,000 rows into the new table, where the original file has 39,000.

View 1 Replies View Related

How To Copy Value From Access Table To Excel File Without Losing Number?

Jul 27, 2007

This forum is really helpful!

I am using following code to copy low value from Access table to excel file, but only to find that it changed in excel file. How should I do to not change that?

ThisWorkbook.Sheets("EV Data").Cells(row + 2, col + 2) = _
rs.Fields(col).Value



RecordIDDateTimeStampSetupIDStringBaseProductIDStringMGDBIDStringVAGLBIDStringPWDCohortIssueAge1IssueAge2NumberOfCellsNumberOfScenariosTotalWeightInitialPremiumEV_MeanEV_P995EV_P99EV_P95EV_P90EV_P75EV_P50EV_P25EV_P10PrEVGTZero
51907/27/2007 7:04:36 PMAccess2006Max72006MGIBAllCombinedAllCombinedAllCombined95010.006800000006810000009.33604218011769E-03-2.48487734766947E-02-2.35810657931309E-02-1.44083677074442E-02-1.10775676515645E-02-2.1878002261516E-037.92060932296671E-031.95193525290664E-023.06835072412068E-020.70658682634731
52007/27/2007 7:04:37 PMAccess2006Max7LifePayIAllCombinedAllCombinedAllCombined185010.005110000001.19424841908013E-02-1.67115163990304E-02-1.42187111112351E-02-8.08910871821918E-03-4.62961276311795E-032.72200376166994E-031.04312882683217E-022.06668892126601E-022.96649979111015E-020.80638722554891
52107/27/2007 7:04:37 PMAccess2006Max7NoneAllCombinedAllCombinedAllCombined95010.0054410000007.98908918707603E-03-1.67789382388317E-02-1.56490361783179E-02-1.07703746693193E-02-0.00753365556878-7.10709517675212E-046.72111941423526E-031.59418102675589E-022.44078788510759E-020.730538922155694
52207/27/2007 7:04:37 PMAccessRat2006MGIBAllCombinedAllCombinedAllCombined95010.0030199999969810000009.52176602967384E-03-1.56233866973614E-02-1.49901562045925E-02-8.41152147122661E-03-5.44762510232609E-034.05576508882054E-047.33588282834675E-030.0164686012768352.61950530898991E-020.754491017964078
52307/27/2007 7:04:37 PMAccessRatLifePayIAllCombinedAllCombinedAllCombined185010.00226499999773510000001.06805510377118E-02-0.014626108301625-1.20428523073918E-02-6.08984658852046E-03-2.22851888030373E-034.04428276871694E-039.82402795120803E-031.68655595406923E-022.40410662469335E-020.856287425149709
52407/27/2007 7:04:37 PMAccessRatNoneAllCombinedAllCombinedAllCombined95010.00241599999516810000005.8666292477999E-03-1.13844546795139E-02-1.04027261898336E-02-6.72766534794549E-03-4.77103336054974E-03-3.11542830732602E-044.5158867397345E-031.06654135236169E-021.76803347713142E-020.730538922155694

View 7 Replies View Related

Getting Query Criteria To Select All Records Or Specific Records In Query Design Section?

Jun 16, 2014

How can I get a Query Criteria To Select All Records or specific records in query design section.

I have a table that shows many departments with credit card transactions. I like to run a query to see specific department, or have an option to see all the departments when the query is run.

View 2 Replies View Related

Query Problem: Records Linked To Records

Oct 31, 2007

Hi,

I was wondering if anyone would be kind enough to help me out on this problem I have.

I have a table:
---------------------------------
Source | LinkedTo
---------------------------------
A1 B2
B2 C1
B2 C2
C1 D1
C2 D2
C2 D3
B2 D4
A1 D5

Another table:

-------------------------------
Item | Load
---------------------------------
D1 2
D2 4
D3 6
D4 8
D5 10

So looking at the tables,
C1 = 2
C2 = 4+6 = 10
B2 = C1 + C2 + D4 = 20
A1 = 20 + 10 = 30

Here, there are 4 levels that I have to go into to get the grand total. If I did not know how many levels there were, how would I be able to do this through code? through queries if possible??

If anyone could help, that would be great! Thank you in advance.

Bear

View 3 Replies View Related

Queries :: Query That Will Return Records From A Table That Have Related Records In Another Table

Mar 4, 2015

I am looking for a query that will return records from a table that have related records in another table. Opposite to the Unmatched Query Wizard.I have two tables: tblSupplier and tblSupplierProducts.The two tables are related by the field "SupplierId".I need the query to only return Suppliers that have Products.

View 3 Replies View Related

Show All Records From One Query And The Sum Of A Field In A Related Query Record

Mar 8, 2005

I'm building a report for annual software license renewals. The report data source is a query that combines the customer information, their computer information, and the licenses purchased for that computer. I am having no trouble with the form displaying the customer info page, then a page with the computer info at the top and a list of licenses purchased for that computer underneath.

That would be great, if that's what my boss wanted. However, she wants the whole list of available licenses displayed on each page, in the event someone want to purchase additional licenses with this year's renewal.

I'm trying to figure out how I can set up a query/report grouping to do that. I've tried making a new query, relating the qryLicense!licenseID to the qryPurchase!purchLicense and setting the relationship option to show all records from qryLicense and only those related from qryPurchase. I added the qryPurchase!purchCPU field to my query, hidden it, and set the criteria to “=1” (the computer ID of one of my dummy computer records). I also have a Sum of the qryPurchase!purchQty field included in the new query that I want to display the total number of that particular license purchased (and 0 if there are no corresponding records). All fields except for the quantity field are set to Group By.

What I’m getting from this is simply a list of the licenses purchased for that computer, not the complete list of licenses available showing the quantity purchased where applicable.

Can someone see where I’m going wrong?

Slaughter
slaughter at mizzou dot edu

View 9 Replies View Related

Queries :: When One Sub Query Has No Records Entire Main Query Is Blank

Oct 1, 2014

I have a query with three sub queries, all returning a number from different tables. But when any one of the sub queries returns a blank, the entire main query is blank.

How do I stop this from happening? I have tried NZ() on the sub queries and on the main query, but the blank still happens.

View 1 Replies View Related







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