This is driving me crazy... Trying to create a view, here's the pared down
example:
CREATE VIEW vCompany (CompanyID, Address) +
AS SELECT companyid, address FROM company WHERE type = 'A' +
UNION ALL SELECT +
companyid, billingaddress FROM company WHERE type = 'B'
I get a "column type mismatch in union". The problem is that the Address and
the
BillingAddress are different lengths. Address is Text 25 and BillingAddress is
Text 40.
It refuses to put the 2 together.
I've tried these, and still get the mismatch:
1. Leaving out the alias column names and letting the view definition decide.
2. Creating a new column alias name like:
CREATE VIEW vCompany (CompanyID, tmpAddress) +
AS SELECT companyid, address FROM company WHERE type = 'A' +
UNION ALL SELECT +
companyid, billingaddress FROM company WHERE type = 'B'
All of it gives me a union type mismatch. I cannot have different lengths of
TEXT columns?
Anyone think of a workaround? I'm going to be using this in a report, and I
suppose
I could add code to create a temp table on the fly, but I really wanted a
view...
Karen