473,789 Members | 2,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to enter data into left join query

3 New Member
I have a program that worked fine then they needed to be able to also see the empty cells (inmate cells) on a housing unit when they ran the query. So what I had to do was take two tables and combine them into one with a query.
The two tables are..inmtinfo and tblcelldata...
inmtinfo
IN_INNUM - primary key
IN_NAME
IN_RACE
IN_BLDING
IN_SECTION
IN_CELLDRM
IN_BED
IN_SEP

tblCellData
CellID - primary key
IN_BLDING
IN_SECTION
IN_CELLDRM
IN_BED
IN_SEP

Query that joins the two...
qurCellData

SELECT inmtinfo.IN_INM NUM, inmtinfo.IN_NAM E, inmtinfo.IN_BLD ING, tblCellData.IN_ SECTION, tblCellData.IN_ CELLDRM, tblCellData.IN_ BEDNUM, tblCellData.SEP
FROM inmtinfo RIGHT JOIN tblCellData ON (inmtinfo.IN_BE DNUM = tblCellData.IN_ BEDNUM) AND (inmtinfo.IN_CE LLDRM = tblCellData.IN_ CELLDRM) AND (inmtinfo.IN_SE CTION = tblCellData.IN_ SECTION) AND (inmtinfo.IN_BL DING = tblCellData.IN_ BLDING)
WHERE (((inmtinfo.IN_ BLDING)="H" Or (inmtinfo.IN_BL DING) Is Null))
ORDER BY tblCellData.IN_ SECTION, tblCellData.IN_ CELLDRM, tblCellData.IN_ BEDNUM;

Now what I use to have was this...query that took inmtinfo and joined it with tblESSlog using a left join so I could us this in a form and enter data into the form.
tblESSLog
ESSID - primary key
IN_INMNUM
SEP
EXERCISE
SHOWER
YARD#
RAZOR
SCREAM
MIRROR
DATE

Query that joined the two and qurESSLog (this one works) but does not give the empy cells that they need on the report.

SELECT inmtinfo.IN_INM NUM, inmtinfo.IN_NAM E, inmtinfo.IN_BLD ING, inmtinfo.IN_SEC TION, inmtinfo.IN_CEL LDRM, inmtinfo.SEP, tblESSLog.EXERC ISE, tblESSLog.SHOWE R, tblESSLog.[YARD #], tblESSLog.RAZOR , tblESSLog.SCREA M, tblESSLog.MIRRO R, tblESSLog.DATE
FROM inmtinfo LEFT JOIN tblESSLog ON inmtinfo.IN_INM NUM=tblESSLog.I N_INMNUM
WHERE (((inmtinfo.IN_ BLDING)="H") AND ((inmtinfo.IN_S ECTION)=[ENTER POD]));

So far I have tried to first use the new qurCellData and join it with tbleESSLog I get the correct info but can not enter data into the ESS part of the query.

SELECT qurCellData.IN_ INMNUM, qurCellData.IN_ NAME, qurCellData.IN_ BLDING, qurCellData.Sec tion, qurCellData.[Cell#], qurCellData.SEP , tblESSLog.EXERC ISE, tblESSLog.SHOWE R, tblESSLog.[YARD #], tblESSLog.RAZOR , tblESSLog.SCREA M, tblESSLog.MIRRO R, tblESSLog.DATE
FROM qurCellData LEFT JOIN tblESSLog ON qurCellData.IN_ INMNUM = tblESSLog.IN_IN MNUM
WHERE (((qurCellData. Section)=[ENTER POD]));

When that did not work I tried this use the qurCellData and make a tblRHUCellData with it then use the tblCellData and the tblESSLog and join them.

tblRHUCellData
CellId - Primary Key
IN_INNUM
IN_NAME
IN_RACE
IN_BLDING
IN_SECTION
IN_CELLDRM
IN_BED
IN_SEP

Query that Joins them (get correct data but can not enter information into ESS part)
SELECT tblRHUCellData. IN_INMNUM, tblRHUCellData. IN_NAME, tblRHUCellData. IN_BLDING, tblRHUCellData. IN_SECTION, tblRHUCellData. IN_CELLDRM, tblRHUCellData. SEP, tblESSLog.EXERC ISE, tblESSLog.SHOWE R, tblESSLog.[YARD #], tblESSLog.RAZOR , tblESSLog.SCREA M, tblESSLog.MIRRO R, tblESSLog.DATE
FROM tblRHUCellData LEFT JOIN tblESSLog ON tblRHUCellData. IN_INMNUM = tblESSLog.IN_IN MNUM
WHERE (((tblRHUCellDa ta.IN_SECTION)=[ENTER POD]))
ORDER BY tblRHUCellData. IN_CELLDRM;


Please help I don't know what I did wrong in the second one (why would it work fine for one but not the other)
Sep 29 '06 #1
0 1504

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2556
by: Gavin | last post by:
Hi, I would like to convert a dollar amount ($1,500) to represent Fifteen hundred dollars and 00/100 cents only for SQL reporting purposes. Is this possible and can I incorporate the statement into an existing left outer join query. Thanks in advance, Gavin
4
4108
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the results, then doing a self left join with those results, etc. What puzzles me is that the time required for the query seems to grow exponentially as I add additional left joins, which I didn't expect. I expected the inner select to return about 25...
4
3400
by: John Baker | last post by:
Hi: I have two tables, a setup table (TblSetup) and a purchase order table (tblPO). When i construct a query with ONLY the tblPO shown, and a type in parameter for the PO number, I an update the original tblPO. However, when I introduce the setup file into the query I cannot update the result. THis is true if I make a link to Setup or not. In fact, setup contains the client ID, which i wish to test against the client ID in the PO...
2
2842
by: frbn | last post by:
hi all, we currently experience an original problem on a production server with a postgresql 7.1.3 ( a bit old, I know :\ ) We just want to know if somebody experienced this problem: the error message : "ERROR: Unable to locate type oid 0 in catalog"
2
13755
by: Bob | last post by:
I'm running sql server ver 7.0 SP4. I have an access project (.adp) that runs a view which is nothing more than a select statement. Access locks up solid when I try to run this query - with NO error messages what-so-ever. If I sign onto the server, and run the view from enterprise manager - I get: "the data provider or other service returned an E_FAIL status" !?!?! There is NO ERROR number, or further explanation of the message!!
3
1703
by: angelnjj | last post by:
I'm going to do my best to describe purpose and what I need...here goes. I'm writing a data entry "quality" report and working. I'm trying to identify anytime a user adds a new contact to the db during a date range that already existed within the account prior to the first date of the range. When the contact existed already, the returned value should be 1, if they didn't exist the returned value should be 0 (I'll then total up all the 1s to...
1
1111
by: rgiebelhausen | last post by:
I have a query built to extract data. No errors when it runs however it gets some of the data but not all of the data. Below is an example of the query and the results. Here is an example... Each job has a PO and multiple lines it might get line 2,3,5,7 but miss 1,4,6,8 Here is the example. This is in sql 2005 --select * from p21_order_view -- use p21 select p21_order_view.order_no, ship2_name, order_date, po_no, line_no,...
1
1939
by: cmgmyr | last post by:
Hey All, I'm having a little problem with exporting data from my database. The problem is that the query seems to be too much for PHP and MySQL to handle since it is timing out. I have the timeout set right now at 3 minutes. I can run this in phpMyAdmin and it usually takes 4-5 minuted to complete. I do not want to have to make the client wait that long for this. This is part of an import/export Excel function that I have made. Here is...
3
2218
samikhan83
by: samikhan83 | last post by:
i am having a problem in getting data from four tables based on a common field in one query. 1. i have product,open_balance,purchase,sales tables and product_id is primary key of product and foreign key in rest of the tables 2. i want to get the sum of the open_balance,purchase and sales for a product based on product key to get current quantity in stock i used Left Join i think i am not writing the query correctly because it is...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.