In teh sql below, the data type for b.branch is text and the data type for f.office is number. I tried to run the statement below and I get data type mismatch. I am sure the "and Clng(b.branch) = f.office" portion is the trouble: when I remove it the statement runs.
select f.fa, f.name,f.empid, f.office, b.description,f.revenue
from [Fiscal 2008] f, [Product Code Table Sept 2008] p, [September 2008 Branch Hierarchy] b
where f.[product code] = p.[prod code]
and Clng(b.branch) = f.office
and f.empid <> ""
and f.empid not in ("99999","99970")
and p.[lvl 2] in (1,4,2)