I keep getting "The specified field "customer" could refer to more than one table listed in the FROM clause of your SQL statement. I understand what it means but I dont know how to change it. I have 11 tables in total.
Below is my statement: -
-
-
SELECT informix_opheadm.date_entered,
-
informix_opheadm.date_required,
-
DateValue([informix_opheadm]![date_entered]) AS Expr1DEnt,
-
DateValue([informix_opheadm]![date_required]) AS Expr2DReq,
-
DateValue([informix_opheadm]![date_despatched]) AS Expr3DDes,
-
informix_opheadm.order_no,
-
informix_slcustm.customer,
-
informix_slcustm.name,
-
informix_opdetm.product,
-
informix_opdetm.product_group_a,
-
informix_opdetm.order_qty,
-
informix_opdetm.value,
-
informix_opdetm.warehouse,
-
informix_stockm.standard_labour,
-
informix_stockm.standard_overhead,
-
informix_stockm.standard_material,
-
informix_opheadm.transaction_anals1,
-
[informix_opheadm]![transaction_anals1]*[Expr1orderqty]/1000 AS Expr1LMEValue,
-
[Expr1orderqty]*[standard_labour] AS Expr1StandardLabour,
-
[Expr1orderqty]*[standard_overhead] AS Expr1StandardOverhead,
-
[standard_material]*[Expr1orderqty] AS Expr1StandardMaterial,
-
([value]-[Expr1LMEValue]-[Expr1StandardLabour]-[Expr1StandardOverhead]-[Expr1StandardMaterial]) AS [Expr1Margin£],
-
[Expr1Margin£]/[Expr1OrderValue] AS [Expr1Margin%],
-
[net_price]*[order_qty] AS Expr1OrderValue,
-
informix_opdetm.net_price,
-
informix_opdetm.despatched_qty,
-
[Expr1StandardLabour]+[Expr1StandardOverhead]+[Expr1StandardMaterial] AS Expr1STDCOST,
-
[value]-[Expr1LMEValue] AS Expr1HVLVALUE,
-
[Expr1HVLVALUE]/[Expr1OrderValue] AS [Expr1HVL%],
-
[order_qty]-[despatched_qty] AS Expr1DES,
-
IIf([despatched_qty]>0,[despatched_qty],[order_qty]) AS Expr1orderqty,
-
[informix_opheadm]![transaction_anals1]/1000*[Expr1orderqty] AS [Expr1LME DESVALUE],
-
([standard_overhead]+[standard_labour]+[standard_material])*[Expr1orderqty] AS Expr1stdvaluedes,
-
[Expr1DESmARGIN]/[value] AS [Expr1MARGINDES%],
-
[value]-[Expr1LME DESVALUE]-[Expr1stdvaluedes] AS Expr1DESmARGIN,
-
informix_opheadm.status,
-
informix_slcustm.territory,
-
informix_slcustm.class,
-
informix_opheadm.status,
-
Areas.Area,
-
informix_opheadm.order_no,
-
informix_opheadm.customer,
-
informix_opdetm.order_no
-
FROM Areas
-
INNER JOIN (infoBetween "A001" And "XZ100"rmix_stockm
-
INNER JOIN ((informix_slcustm
-
INNER JOIN informix_opheadm
-
ON informix_slcustm.customer = informix_opheadm.customer)
-
INNER JOIN informix_opdetm
-
ON informix_opheadm.order_no = informix_opdetm.order_no)
-
ON (informix_stockm.product = informix_opdetm.product)
-
AND (informix_stockm.warehouse = informix_opdetm.warehouse))
-
ON Areas.Territory = informix_slcustm.territory
-
WHERE (((DateValue([informix_opheadm]![date_entered])) Between [Forms]![frmFindDates]![cmbStartDate] And [Forms]![frmFindDates]![cmbEndDate])
-
AND ((DateValue([informix_opheadm]![date_required])) Between [Forms]![frmFindDates]![txtDateRequiredStart] And [Forms]![frmFindDates]![txtDateRequiredEnd])
-
AND ((informix_opheadm.order_no) Between "04*" And "06*") AND ((informix_slcustm.customer) Between "A001" And "XZ100") AND ((informix_opdetm.warehouse) Between "10" And "79")
-
AND ((informix_opheadm.status) Between [Forms]![frmFindDates]![txtStartStatus] And [Forms]![frmFindDates]![txtEndStatus]));
-
-
1 2240
There is no obvious problem with your SQL statement, as all occurrences of the field name 'customer' are qualified with the relevant table names. It is a relatively complex statement with many clauses in the WHERE part. My feeling is that the error message is really reflecting the query engine finding the statement too complex to interpret.
Given that the SQL you show has no obvious syntax problem I'd suggest breaking this complex query down into at least two separate, simpler, queries which can be joined together to create the final result.
Breaking such a query into simpler components will also make it much easier to confirm by testing that the WHERE clauses are selecting the correct records and that any computed results are accurate.
-Stewart
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mr. Smart |
last post by:
I have a middle-tier written using Foxpro. I'd like this tier to coommunicate
(that is pass some variables to ASP). I defined a Session variable somewhere
in my ASP file, e.g. Session("Usercode") =...
|
by: Jeffrey |
last post by:
Good day all,
I have seen so many postings dealing with MS Access as a security risk
and other items, yet I see now clear reason why. I would really like
someone to point me in the right...
|
by: Larry Woods |
last post by:
Anyone have an Access 97 runtime? Or know where there's a download?
There shouldn't be any problem giving me a copy since you can send it out
free with any *.mdb/*mde.
TIA,
Larry Woods
|
by: Darren Smith |
last post by:
Hi There,
I have a shopping cart app that displays products along with a textbox
(to enter quantity) and an image button to add the item to the
shopping cart. Please explain why my below...
|
by: cj |
last post by:
I'm trying to forge ahead with Visual Basic .Net but recently I've suffered
several major set backs in demonstrating VB is the future and we should move
from Visual FoxPro.
I really need to find...
| |
by: Karina |
last post by:
Hello:
I am taking over someone else's code and my users are experiencing tons of
problems but when I try to go into the source code to edit and try to fix
these problems, I realize that all the...
|
by: SMS |
last post by:
Hi,
We have our web-site developed in classic ASP, and I need to add this
additional feature on one of the pages to access a VB application. How
can I do that?
The VB application basically...
|
by: insideview |
last post by:
Hi there - when attempting to install Python 2.3.5, I receive the
following message -- "You do not have access to make the required
system configuration modifications." Please rerun this...
|
by: karrans |
last post by:
Hi,
I'm trying to debug some code where I'm trying to retrieve particular ranges in an excel sheet into an Access table, depending on the user selection of the range name in a combo box with a...
|
by: jmc |
last post by:
I am setting up a new database at work and I am having troubles with the security. It is a simple database with 1 table, form and report. I have set up user names and passwords to get in. Is there...
|
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: 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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |