P
Phil Stokes
I have a table with orders information which relates to cutomer information
in another table. I have also got a table of delivery addresses relating to
certain customers. these are amalgamated in a union query with the billing
addresses of each customer giving a comprehensive list of addresses for all
of the customers (The billing address having the identifier 0 and the
delivery addresses having the identifier alotted to them in the delivery
address table.) I have created a unique identifier for the delivery address
(to be stored in the orders table) be it the billing address or a different
delivery address using the clientsID(autonumber field in clients table) and
the DeliveryID from the Delivery Address table using the following SQL code
SELECT Trim(Str([Client NO]))+"-0" AS ShipClientID, [Client No], [Client
Name], [Client Address1] & ", " & [Client Address2] & ", " & [Client
Address3] & ", " & [Client Address4] AS [Billing Address], [Client Fax No]
FROM Clients
UNION SELECT Trim(Str([Client NO]))& "-" &Trim(Str([AltClientNoID])) AS
ShipClientID, [Client No],[Delivery Name] AS Name, [Delivery Address2] & ",
" & [Delivery Address3] & ", " & [Delivery Address4] AS [Delivery Address],
[Delivery Fax No]
FROM tblClientDelivery;
this produces a table with identifiers such as "124-4 for the fourth
delivery addres of client number 124. This is naturally stored as a text
field.
the related record in the orders table is stored as a text field and is
input using a combo box on the orders form that writes the ShipClientID to
the orders table.
when I create a query for a report I get "type mismatch in expression".
Are there any specific rules regarding relationships between two text
fields. can anyone suggest a way around this situation.
in another table. I have also got a table of delivery addresses relating to
certain customers. these are amalgamated in a union query with the billing
addresses of each customer giving a comprehensive list of addresses for all
of the customers (The billing address having the identifier 0 and the
delivery addresses having the identifier alotted to them in the delivery
address table.) I have created a unique identifier for the delivery address
(to be stored in the orders table) be it the billing address or a different
delivery address using the clientsID(autonumber field in clients table) and
the DeliveryID from the Delivery Address table using the following SQL code
SELECT Trim(Str([Client NO]))+"-0" AS ShipClientID, [Client No], [Client
Name], [Client Address1] & ", " & [Client Address2] & ", " & [Client
Address3] & ", " & [Client Address4] AS [Billing Address], [Client Fax No]
FROM Clients
UNION SELECT Trim(Str([Client NO]))& "-" &Trim(Str([AltClientNoID])) AS
ShipClientID, [Client No],[Delivery Name] AS Name, [Delivery Address2] & ",
" & [Delivery Address3] & ", " & [Delivery Address4] AS [Delivery Address],
[Delivery Fax No]
FROM tblClientDelivery;
this produces a table with identifiers such as "124-4 for the fourth
delivery addres of client number 124. This is naturally stored as a text
field.
the related record in the orders table is stored as a text field and is
input using a combo box on the orders form that writes the ShipClientID to
the orders table.
when I create a query for a report I get "type mismatch in expression".
Are there any specific rules regarding relationships between two text
fields. can anyone suggest a way around this situation.