Question : Problem (AGAIN) Data Type Mismatch in criteria expression

It seems I have this problem every week or so.  I have a query that's trying to join a table and another query (on a linked table).  

The details:
Problem Query
Joins:

Table: has a field with a text field named: short_order_id

Query:
Query based on linked table with text field name ConvertedID with the following formula:
ConvertedOrderID: CStr(Right([Order_Num_BWC],Len([Order_Num_BWC])-InStr([Order_Num_BWC],"-")))unique id

So, my query is linking these two fields (short_order_id & ConvertedOrderID)

and it's giving me the infamous error: Date Type Mismatch in Criteria Expression

Any ideas/help is greatly appreciated.


ConvertedOrderID: CStr(Right([Order_Num_BWC],Len([Order_Num_BWC])-InStr([Order_Num_BWC],"-")))
Order_Num_BWC

Answer : Problem (AGAIN) Data Type Mismatch in criteria expression

If the field Order_Num_BWC is already a text field you don't need the Cstr() function.

If you look at the datasheet output of your first query as it is, do the converted ConvertedOrderID values line up left or right in the column?

(This query)
SELECT BWC_MasterFile.Order_Num_BWC, CStr(Right([Order_Num_BWC],Len([Order_Num_BWC])-InStr([Order_Num_BWC],"-"))) AS ConvertedOrderID, Right([Order_Num_BWC],Len([Order_Num_BWC])-InStr([Order_Num_BWC],"-")) AS ConvertedOrderID2, BWC_MasterFile.Product, BWC_MasterFile.Shipping, BWC_MasterFile.ShippingType, BWC_MasterFile.Total, BWC_MasterFile.InvoiceDate
FROM BWC_MasterFile;

Your query is assuming that every Order_Num_BWC value will have a "-" in it, and your formula will fail if any values don't have a hyphen in them. Visually check the output of that query to see if it has any #error values in the column. You definitely won't be able to join on an expression that evaluates to #error, even if it is only #error on one line of the result set of the first query.
Random Solutions  
 
programming4us programming4us