Greetings,
I have a query that looks like this in SQL:
SELECT tblCommit093004.Currency, First(tblCommit093004.Commitment) AS
FirstOfCommitment, First(tblCommit093004.Drawn) AS FirstOfDrawn,
Sum(tblTransactions.DDAmount) AS SumOfDDAmount,
Sum(tblTransactions.Indirect) AS SumOfIndirect,
tblPartnerships.AcctNumber, tblBankInfo.CashAcct,
tblPartnerships.PshpName
FROM tblBankInfo INNER JOIN ((tblPartnerships LEFT JOIN
tblTransactions ON tblPartnerships.PshpID = tblTransactions.PshpID)
INNER JOIN tblCommit093004 ON tblPartnerships.PshpID =
tblCommit093004.PshpId) ON tblBankInfo.AcctNumber =
tblPartnerships.AcctNumber
WHERE (((tblTransactions.TransDate)>#9/30/2004# And
(tblTransactions.TransDate)=[Forms]![frmTransMain]![sfrmTrans].[Form]![TransDate]))
GROUP BY tblCommit093004.Currency, tblPartnerships.AcctNumber,
tblBankInfo.CashAcct, tblPartnerships.PshpName, tblCommit093004.PshpId
HAVING (((tblCommit093004.PshpId)=[Forms]![frmTransMain]![PshpID]));
It works fine except when tblTransactions doesn't have any records
fitting the criteria (date). Then, I get an empty query. I thought
that the LEFT JOIN between tblPartnerships and tblTransactions would
ensure that I'd get matches to the HAVING clause from tblPartnerships,
tblCommit093004, and tblBankInfo even when there are no matches in
tblTransactions, but no - it behaves as though it was an inner join.
What am I missing?
Thank you for considering the problem.
Yisroel 1 1659
I have had similar results, and solved them by adding another criterium in
the where-clause. In your case this would be someting like
WHERE ((((tblTransactions.TransDate)>#9/30/2004#) OR
(tblTransactions.TransDate = null) And
(tblTransactions.TransDate)=[Forms]![frmTransMain]![sfrmTrans].[Form]![Trans
Date]))
Perhaps something like this would work for you too.
Bas Hartkamp.
"Yisroel Markov" <ey*******@iname.com> wrote in message
news:2f**************************@posting.google.c om... Greetings,
I have a query that looks like this in SQL:
SELECT tblCommit093004.Currency, First(tblCommit093004.Commitment) AS FirstOfCommitment, First(tblCommit093004.Drawn) AS FirstOfDrawn, Sum(tblTransactions.DDAmount) AS SumOfDDAmount, Sum(tblTransactions.Indirect) AS SumOfIndirect, tblPartnerships.AcctNumber, tblBankInfo.CashAcct, tblPartnerships.PshpName FROM tblBankInfo INNER JOIN ((tblPartnerships LEFT JOIN tblTransactions ON tblPartnerships.PshpID = tblTransactions.PshpID) INNER JOIN tblCommit093004 ON tblPartnerships.PshpID = tblCommit093004.PshpId) ON tblBankInfo.AcctNumber = tblPartnerships.AcctNumber WHERE (((tblTransactions.TransDate)>#9/30/2004# And
(tblTransactions.TransDate)=[Forms]![frmTransMain]![sfrmTrans].[Form]![Trans
Date])) GROUP BY tblCommit093004.Currency, tblPartnerships.AcctNumber, tblBankInfo.CashAcct, tblPartnerships.PshpName, tblCommit093004.PshpId HAVING (((tblCommit093004.PshpId)=[Forms]![frmTransMain]![PshpID]));
It works fine except when tblTransactions doesn't have any records fitting the criteria (date). Then, I get an empty query. I thought that the LEFT JOIN between tblPartnerships and tblTransactions would ensure that I'd get matches to the HAVING clause from tblPartnerships, tblCommit093004, and tblBankInfo even when there are no matches in tblTransactions, but no - it behaves as though it was an inner join.
What am I missing?
Thank you for considering the problem.
Yisroel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rigga |
last post by:
Hi,
I am new to mysql and need help on how to join tables. I have a database
which contains 4 tables, the main table contains information by date order
and the other 3 contain data also in date...
|
by: Rick Caborn |
last post by:
Does anyone know of a way to execute sql code from a dynamically built
text field?
Before beginning, let me state that I know this db architecture is
built solely for frustration and I hope to...
|
by: dskillingstad |
last post by:
I've been struggling with this problem for some time and have tried
multiple solutions with no luck.
Let me start with, I'm a novice at Access and I'm not looking for
someones help to design my...
|
by: Ahmet Karaca |
last post by:
Hi.
myds.Reset();
mycommand.SelectCommand.CommandText=
"Select att1 from Ing as Ingredient, Pro as Product "+
"where Pro.ad='apple' and Pro.id=Ing.id";
mycommand.Fill(myds, "Product"); // Here...
|
by: Graham |
last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
|
by: Ike |
last post by:
I have a simple query of joined tables that is failing to give me any rows
of data (though, in checking by hand, it certainly should). Essentially, I
am trying to return all rows from `ups` that...
|
by: beargrease |
last post by:
I'm kind of comfortable with basic joins, but a current project requires a complex query of many tables. The GROUP_CONCAT(DISTINCT ...) function has been very useful as returning my values as comma...
|
by: javediq143 |
last post by:
Hi All,
This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
|
by: amit2781 |
last post by:
Hi,
I have created 4 tables in 'amit' database and then I deleted them. Still I able to get information about the table_schema for the table deleted.
After drop table when I fire a query for...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |