SQL Expert Help Needed- Getting Complex Joins To Work In Access
Jun 28, 2006
I am trying to execute the SQL below (tested in other programs, works fine) but access is giving me the "join expression not supported" error. How can this query be used in MS Access? I have tried breaking some of the joins clauses into separate queries, but I can't get it to work and it is making things much more complicated. Also note that moving the join conditions to the where clause could impact performance (this is a very large DB) Could I execute this via code somehow? Thanks.
SELECT lp.loan_id, lp.days_delinquent, lp.current_balance, pc.product_name
FROM mtgwl.loan_payment lp
inner join mtgwl.deal_loan_relation dlr on
lp.loan_id=dlr.loan_id
and lp.time_out='9999-12-31-23.59.59.0'
and lp.as_of_date='2006-04-30'
and dlr.time_out='9999-12-31-23.59.59.0'
and dlr.type='DEAL'
inner join mtgwl.deal_loan_relation pdr
on dlr.deal_id=pdr.loan_id
and pdr.time_out='9999-12-31-23.59.59.0'
and pdr.type='PRODUCT'
inner join mtgwl.product_control pc
on pc.product_id=pdr.deal_id
and pc.time_out='9999-12-31-23.59.59.0'
and pc.product_name='GSAMP 2003 AHL'
View Replies
ADVERTISEMENT
Jun 28, 2006
I am trying to execute the SQL below (tested in other programs, works fine) but access is giving me the "join expression not supported" error. How can this query be used in MS Access? I have tried breaking some of the joins clauses into separate queries, but I can't get it to work and it is making things much more complicated. Also note that moving the join conditions to the where clause could impact performance (this is a very large DB) Could I execute this via code somehow? Thanks.
SELECT lp.loan_id, lp.days_delinquent, lp.current_balance, pc.product_name
FROM mtgwl.loan_payment lp
inner join mtgwl.deal_loan_relation dlr on
lp.loan_id=dlr.loan_id
and lp.time_out='9999-12-31-23.59.59.0'
and lp.as_of_date='2006-04-30'
and dlr.time_out='9999-12-31-23.59.59.0'
and dlr.type='DEAL'
inner join mtgwl.deal_loan_relation pdr
on dlr.deal_id=pdr.loan_id
and pdr.time_out='9999-12-31-23.59.59.0'
and pdr.type='PRODUCT'
inner join mtgwl.product_control pc
on pc.product_id=pdr.deal_id
and pc.time_out='9999-12-31-23.59.59.0'
and pc.product_name='GSAMP 2003 AHL'
View 2 Replies
View Related
Oct 30, 2007
I have a database in which i am trying to create some forms in order to search for records. The database contains several tables. Some tables are linked using a compound key while others have a single PK. I created the search form which has different searching criteria. Once a user selects the criteria, they hit the search button (there are different buttons for each type of search) the button opens up a form to display all the data. The problem is that there are many tables to report on. I created a form with a subform. The tables associated with the main form are all being retrieved fine. however the subform doesn't seem to work. I created the subform using a query to select all the fields from the desired tables, i gave this query a criteria based on the main form so that the Id's would match. (ie. Main form ID = Firstable in subform.ID)
I got a blank sheet in the subform when i used the search. i presumed that my query was not pulling records because of the referential integrity rules. i went in and changed the relationship rules so that it would include all records from the first table and matching records from the second table. (middle option in the list when editing a relationship) I now get the following error when i try to run the query.
"The SQL statement could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include that query in your SQL statement."
Could someone please tell me what this means as the help is... how shall we say it.. written in true Microsoft Fashion.
And though it tells me how to fix it, i'm not really sure what it's telling me to do. I am using Access2003 But the Database is in an access 200 file format.
Thanks.
View 3 Replies
View Related
Oct 3, 2005
Hi,
I hope someone can help me, I have a database compiled from different sources which means that information in fields that need to be linked are written differently, meaning that I can't just simply make a relationship between them.
The two tables I would like to link are,
Table 1 has the fields OCCUPATION and AMOUNT and contains over 740,000 records.
Table 2 has the fields COMPANY_NAME and TICKER and has 500 records.
I need to find a way for all COMPANY_NAME fields in table 2 to be cross-referenced with the OCCUPATION field, so if COMPANY_NAME is part of the string in the OCCUPATION field then the TICKER (of that company) can be attached to the record in table 1 (specifically to AMOUNT).
The problem is that the OCCUPATION field is not written in a standard form and can include either only the occupation, only the company name, or both in either order.
I can make a seperate query for each company by using as criteria "like "*[COMPANY_NAME]*", but then I would have to do this 500 times!!! Is there a way to automate this?
The final purpose is to link the AMOUNT to TICKER so as to find the sum of all the amount associated with a company.
I really hope you can help, I have little programming knowledge and it will save me the time of making 500 seperate queries. The final use is for my thesis studying private contributions in the american elections.
Thanks in advance (I hope),
Onur
View 1 Replies
View Related
Dec 6, 2007
Hello,
Does anyone know of a listing or a publication/website where I can place an ad for an expert to develop an Access database? We need someone to do this work for our organization.
Thanks.
View 5 Replies
View Related
Feb 17, 2008
I am an inexperienced user, part of my job is to up date data files daily, have been doing so for 7 months. Problem arose when I accidentally deleted a link and required IT assistance trying to locate where it had gone--
that's when we discovered that I was not updating the company-wide server but a separate shortcut that a previous (and briefly employed individual had created).
Now IT and I tried a few tricks to combine or join the data I had entered (this could be history of up to 2000 assets), but have not figured out just how.
I have backed up my data on a thumb drive to prevent loss in case of my hard drive accidentally failing or crashing due to weather, now I need advice on how to put that data into the main Access data base--w/o having to do it all manually again.
Does anyone know how to do this?
I would greatly appreciate your help!
View 2 Replies
View Related
Oct 19, 2005
I have a situation. In completing our Annual Report for our Accrediting body for my school, it requires us to complete a 'Completion and Placement Chart'. This chart was provided to us in Excel. The problem was that we needed a system to automaticaly update this chart as the year progressed so we can visually see our completion and placement rates. With this, I created an Excel sheet with the Completion and Placement Charts and made it so it can be updated as I entered a students information in.
Although it does calculate the data properly, the process is extremely ugly. It is terrible in appearance, function, and by all means, far from user friendly (I understand it, but it takes some explaining to do for someone else). This Workbook that I created houses almost all the information I need with the exception of it being entirely unsafe and far from being secure and data entry is a nightmare.
So, this brought me to Access. I created a database for this purpose (first time using access as well). It works like a dream in storing all the data that I need and keeping it safe. I needed to have a 'Placement Tracking Document' for each student outlining the students information for the accrediting body. This was done wonderfuly in Access and could not be accomplished through Excel (that I know of). However, I NEED to have Access tally all the information in the 'Completion and Placement Charts' like the Excel Workbook does. I need to keep the exact format of the 'Completion and Placement Chart' because it is a standard form in Excel and I can not steer away from it.
How can I get my DB in Access to comunicate with the 'Completion and Placement Charts' and have it automatically tally like my workbook???
I have attached some screen shots of my database and the entire Excel Workbook (Its edited because of confidential data) so you can understand a little of the chaos.
I rarely used Excel and never used Access until now. It took me nine months to create what I have because I was learning as I went. The books that I purchased to help me out do not touch this subject nearly enough (Access Cookbook, Access for Dummies and VB & VBA in a nutshell).
My point is, any help or direction in where to get thorough information on how to acomplish this is more then welcome. Any comments on what I have as well is more then welcome (negative or positive).
Thank you thank you thank you thank you in advance!
Oh, and use the buttons in the Excel Workbook to navigate.
John D :confused:
View 7 Replies
View Related
Oct 26, 2005
I need to execute a complex query. I can get the query to work if I break it into two queries, queryA and queryB, and then use queryB inside queryA. Note that queryB (combined query) produces the final results I want.
Here is the code for queryA
---------------------------------
SELECT
Table_Subgrantees.ID,
Table_Subgrantees.SDPISubNumber,
Table_Subgrantees.SDPIName1 AS SDPINameSubgrantee,
Table_Subgrantees.SDPIName2 AS SDPIName2Subgrantee,
Table_FormLogInfoSubgrantees2004.FormRequired AS FormRequiredSubgrantee, Table_FormLogInfoSubgrantees2004.FormRequiredComme nts AS RequiredCommentsSubgrantee
FROM Table_Subgrantees INNER JOIN Table_FormLogInfoSubgrantees2004 ON Table_Subgrantees.SDPISubID = Table_FormLogInfoSubgrantees2004.SDPISubID;
Here is the code for queryB
--------------------------------
SELECT
Table_AreaAbbrs.AreaAbbr,
Table_AreaAbbrs.AreaID,
Table_Grantees.SDPINShort,
Table_Grantees.SDPINumber,
Table_FormLogInfoGrantees2004.FormRequired,
Table_FormLogInfoGrantees2004.FormRequiredComments ,
Table_Grantees.SDPIName1,
Table_Grantees.SDPIName2,
QueryA.SDPISubNumber,
QueryA.SDPINameSubgrantee,
QueryA.SDPIName2Subgrantee,
QueryA.FormRequiredSubgrantee
FROM (Table_AreaAbbrs INNER JOIN (Table_Grantees LEFT JOIN QueryA ON Table_Grantees.ID = QueryA.ID) ON Table_AreaAbbrs.AreaID = Table_Grantees.AreaID) INNER JOIN Table_FormLogInfoGrantees2004 ON Table_Grantees.ID = Table_FormLogInfoGrantees2004.ID;
------------------------------------------------------------------------------------------------
I need to execute this query from ADO inside my code so I would like to come up with a single query that will return the results I want. I have played around with it for quite a while and everything I come up with generates messages like: "Join expression not supported".
Can anyone help me write this query as a single query?
Thank You,
Becky
View 1 Replies
View Related
Dec 4, 2007
Good day all
I have a simple query linking two tables using the primary keys from each. The problem is that every time I go into design mode of the form that uses the query to populate a list box I get a Data Type Mismatch error and when I look at the query, Access has changed the join from the Pk in one table to the field after the PK in the other field. I have attached an image to show the change. Note that the join should be from the first fields on each table. I am really stuck with this guys, it is gettin me down and preventing me from developing the database further and my boss is on my case. Can anyone please help me? I have checked all the table relationships and they are fine. Thank you.
Gareth:(
View 13 Replies
View Related
May 26, 2005
Hi, Big Jim here:
I am really not sure where to ask this one.....
My boss and I are in a jam. We have been using Access to run a reporting process, but one of our tables will exceed the maximum fields allotted this month. Our thought, dump the table into SQL Server and use the GUI interface provided in Access Projects.
Unfortunately, the query designer seems to have a few drawbacks. The one that effects us the most is in using UPDATE queries where more than one table is used to determine records to be updated. In attempting it, we get the message: "The designer does not graphically support the Optional FROM clause SQL construct".
Now I know we can manually create Update Queries, but we often need 1,000+ in a short period of time. Manually punching in all the fields involved and other code just isn't timely.
Question: Is there some alternative, service pack or anything else that would allow us to graphically create these Update Queries using Access Projects or even SQL Server 7.0? I would hate to have to scrap all the work we did over something that seems so minor.
Thanks in advance!
Big Jim
Set Up:
Windows XP
Office XP
SQL Server 7.0
View 4 Replies
View Related
Aug 14, 2007
Hi again,
I just restructured my DB and I was wondering if anyone can give me some advice on whether or not my joins/relations are correct. I left some joins/relations out because I wasn't sure what relation I should use.
Any Advice will be greatly appreciated
18418
View 2 Replies
View Related
Apr 15, 2015
I am trying to develop a query in MS Access 2010 to join two tables using three joins one of which is a (between) date range. The tables are contained in Access.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
[code]...
View 4 Replies
View Related
Dec 8, 2014
I have a form with 47 subForms, and Form.Controls.count is 351. The sub forms were originally text boxes, which got changed to ListBoxes because of customer requests, then to subforms because of conditional formatting needs that the customer wanted. Now, when it is open, other forms give sporadic "System Resources Exceeded" errors. I'm pretty sure it is this form that is causing the errors, as it is always open when they occur. (Only consistent factor.) Task Manger - Processes shows that closing this form releases 723 "User Objects", and almost 400 GDI objects.
Is it time to switch to a different development tool? Visual Basic? C++. Is it possible to rewrite the single form as a standalone and keep using the rest of the Access App? (Almost 60,000 loc in 200 objects.)
View 1 Replies
View Related
Jan 9, 2008
I work for a property management compnay and they have put me in charge of coming up with a way to go some what paperless. What they are wanting is a way to enter a work order for a particular client (i.e description of work to be done for maintenance). This would then need to be printed in a report to be faxed over to the workers. This info would then need to be pulled out and placed into an invoice where, where items could be entered such as items bought ets.
My company is willing to spend thousands for software, but I think it is insane. to do so.
I was thinking that surely this could be done in access. I have an understanding of how access works (forms, reports, tables, etc.) but I have never designed one like this.
It does not have to be complex and it does not have to have a lot of formulas, I was thinking that the total could be placed in field when the invoice info is entered. Only really calculation would be adding the total of the items.
Anyway is this something that can be done relatively easily by someone with my experience, or is this to complex.
Thank You for your time
View 1 Replies
View Related
Jul 19, 2014
They are receiving e-mail with some data that they want to transfer to access database to track. The one think they can do is copy past, copy paste. That is a lot of data to copy and paste. The date looks like this format
Field1
Text1
Field2
Text2 (text2 can be more than 255 char)
Field3
Text3 (text3 can be more than 255 char)
Field4
Text4
Field1
Text1
Field2
Text2 (text2 can be more than 255 char)
Field3
Text3 (text3 can be more than 255 char)
Field4
Text4
and so on.. It can be 50 records
I am thinking they can copy this to the text file. Then the code form Access grabs the text file and imports to access table with format below.
Field1 Fied2 Field3 Field4
Text1 Text2 Text3 Text4
View 14 Replies
View Related
Jun 19, 2005
The question is whether or not to normalize the fields "Place of Birth/Place of Death" in my 100'000 records famous people data base. So far, 15'000 different birth places are deployed. Only 3'000 of them are used more then once, that is to say from 2 to a maximum of 1000 times (New York City). 12'000 birth places are therefor used only once up to now. So, a table of 15'000 places would need a 3-digit (all characters used) or even a 5-digit (numbers only used) identification. In the latter case the ident would often be longer than the returned value (Wien, Oslo, Rom, it's in german, you know). Furthermore, instead of just entering a birth place like "Novodny Chomarowsky" I had to search the table of places whether or not the entry has been used yet. Please supply strong pro-normalization-arguments.
View 14 Replies
View Related
Jun 20, 2006
Good Morning,
I am new to Access and I welcome expert guidance on the relationships of my database. The database will be used to track employee training and although I've enjoyed limited success so far I'm hoping that eventually I'll get it right.
The database has to do just a few things so it doesn't have to be very complicated. It basically has to store employee, training event, and completed training event information. The attachment shows the tables and their relationships.
The are basically two types of training that the database needs to store. The first is training that applies to everyone and the other is training that only applies to certain job specialties. These types of training are identified by the ProjectMandatoryCode and the JobCode respectively.
The ProjectMandatoryCode is a default value that is automatically entered everytime a new employee is entered into the database (EmployeeInfo table) and it is also a default value when a training event is entered into the (TrainingEventInfo table) that applies to everyone. The employee JobCode is a selection when a new employee is entered into the EmployeeInfo table.
When the user wants to enter a training event that is job specific, they are able to select a JobCode from a combo box/option group and this code is written to the record. Selecting one button from the option group writes a default value (ProjectMandatoryCode) to the TrainingEventInfo table while selecting the other button enables the combo box so that a specific JobCode can be entered against the event.
Everything works fine except... so far I've been unable to produce a report that lists every training event that pertains to the employee whether it be ProjectMandatoryCode or JobCode related. I can query and produce completed events or a list of what events are required but nothing that is complete. Ideally, I should be able to produce a complete training plan for the employee which shows all necessary events and where the employee has completed the task I should be able to show the DateCompleted.
This failure has led me to doubt my table relationships since all my efforts at various query joins have failed. Is there anyone who could enlighten me so that I could learn from this, complete this task, and apply this new knowledge to future databases? To the person with the answer, thank you in advance for your assistance. Respectfully,
Dale Gagnon
View 5 Replies
View Related
Nov 1, 2004
please see post #4
View 3 Replies
View Related
Mar 14, 2005
I have a very simple SQL stmt
Select * from MyTbl order by MyID
The error: "Syntax error in ORDER BY clause"
If I remove the order by clause, it works. Now, I have been programming for 30 years and for the life of me, I cannot figure this one out. It is my first use of 'order by' on this ISP so I am assuming there is a server thing? Can anyone suggest to me what this might be? Thank you very much.
-Extremely Frustrated (Ken)
View 10 Replies
View Related
Nov 2, 2007
hi im pretty new to this, using access2000 i believe
i have a large amount of data and have been able to join them successfully. using the "left" "Operator" "right"
one of the things id like to join are dates, but the dates i want to join are not exactly equal to each other so i cant just use a operator "=".
i need to be able to tell access to link the dates within say 30 days of each other.
Ideally something like “left” “>” “right” -30
currently im using excel to do this for me but if access can do it then it would be great.
in excel i use a macro which matches dates within 30 days, and just use a simple
If range("A1") < range("A2") + 30 and range("A1") > range("A2") - 30 then ...........
so is it possible to have access join things within a range?
would be grateful for any help ;)
View 2 Replies
View Related
Jan 12, 2005
Trying to get the selection of one combo box to filter the selections of a second combo box.
Have the following tables:
Sections with the colums SectionID and SectionName
SubSection with Colums SubSectionID, SubSectionName, and SectionID.
Points which has a column for Section, and SubSection,
Would like to have the section combobox in the POINTS table filter the SubSection combobox selections to only include the subsections in that section. Any help would be appreciated!
View 2 Replies
View Related
Aug 19, 2005
I want to create a software in vb using access as database. I want the database to be created using the queries, not using the recordset type.
I want the s/w to be created using insert, select, update, delete etc queries.
what are the steps i need to do for this
plz help
Sagar
View 1 Replies
View Related
Nov 26, 2007
I created a blank database and imported an excel spreadsheet into it to create a new table. Everything imported fine. When I try to import a 2nd spreadsheet into the newly created table, I get an error message saying that the file couldn't be imported. All of the headings are the same but I am not sure what is causing the problem. Any help is greatly appreciated. Thanks Carol
View 6 Replies
View Related
Jul 13, 2005
I have an application on access that export the data to word.
I did a query and the data export to word
my code is:
Dim db, rst
Dim strSQL As String
Set db = CurrentDb
'÷éùåø åôúéçú ååøã, åäöâúå áöåøä îåñøú
Dim objWord 'As Word.Application
'Set word as an application and make it invisible
Set objWord = CreateObject("Word.Application")
objWord.Visible = False 'True is visible
'ùí äîñîê
objWord.Documents.Add ("C:doc3.doc")
strSQL = Me.strSQL
Set rst = db.OpenRecordset(strSQL)
rst.MoveFirst
Dim strString As String
strString = ""
Do While Not rst.EOF
'ID---------------------------------
strString = strString & rst!nameID & vbTab & vbTab & "|"
'name-------------------------------
If Not IsNull(rst!fName) Then
strString = strString & rst!fName & vbTab & vbTab & "|"
End If
'lName---------------------------------
If Not IsNull(rst!lName) Then
strString = strString & rst!lName & vbTab & vbTab & "|"
End If
rst.MoveNext
strString = strString & vbCrLf
Loop
objWord.ActiveDocument.Bookmarks("aaa").Select
objWord.Selection.Text = strString
objWord.Visible = True
my question:
I want to export the data to a table in word.
I attach the file
(to work good put the file "doc3.doc" to "c:/")
how can I do it?
thanks :)
View 4 Replies
View Related
Sep 27, 2005
Hey guys , I was wondering if you can help me with this one cos I am clueless. I am in charge of updating this website which sells stationeries, office equipments etc. Well the catalogue in our website is kinda messy since there are lot of the product items inside the catalogue page which has no images.It is embarassing for those customers who wants to buy a product but couldnt see the picture of the items. For example , http://www.mellon.com.sg/catalogue/s_searchresult.asp?searchby=category2&searchfield=laminating%20materials.
The product items are generated from the Access database where I also included a column field in the database called "Picture" where those product items with images have checked(tick) in the box and those without images are unchecked(no tick) in the box I am not sure if I should filter anything or set up any criteria for the pictures from the database. I need help as i am not a total expert in Access
View 1 Replies
View Related
Jan 11, 2005
Hello there
I am trying to sort out some data. Because it is too huge for microsoft excel, I have to use Access to open it. But when I managed to open the data and wish to edit the data, it keep popping out this message "Updating data in a linked table is not supported by this ISAM"
Can anyone help me to sort this out?
Thank you very much
View 2 Replies
View Related