KrazyKasper
Board Regular
- Joined
- Aug 28, 2008
- Messages
- 87
I have two tables, both of which have the field SalesDocumentId. In one of the tables the field has a prefix SO- and I am trying to eliminate that so I can compare the two fields.
When trying to run the following query, I get the error "Invalid Bracketing of Name Shipments.SalesDocumentId". It does not seem to like my using the table name "Shipments" but if I eliminate that, it gives an error of "the specified field could refer to more than one table listed in the From clause".
I tried various bracketing but nothing seems to work. Do I need to dothis in two separate queries?
SELECT Mid([Shipments.SalesDocumentId],4) AS TruncSalesDocTyp
FROM dbo_Shipments INNER JOIN dbo_InvoiceDetail ON dbo_Shipments.SalesDocumentId = dbo_InvoiceDetail.SalesDocumentId;
When trying to run the following query, I get the error "Invalid Bracketing of Name Shipments.SalesDocumentId". It does not seem to like my using the table name "Shipments" but if I eliminate that, it gives an error of "the specified field could refer to more than one table listed in the From clause".
I tried various bracketing but nothing seems to work. Do I need to dothis in two separate queries?
SELECT Mid([Shipments.SalesDocumentId],4) AS TruncSalesDocTyp
FROM dbo_Shipments INNER JOIN dbo_InvoiceDetail ON dbo_Shipments.SalesDocumentId = dbo_InvoiceDetail.SalesDocumentId;