Union Query Data type Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have four tables that have the same columns and data types (4 different fiscal years data). I have a union query that combines the information into one table using UNION ALL. Then I am querying the Combined table, but I am having trouble because it says that my number fields are text. I have a field called RealAmt that is a Double Number data type in all four tables that are unioned. When I try to write criteria to query that combined field (RealAmt >0 and <100) it turns it into (RealAmt >"0" and <"100") so my results are incorrect. Any help would be appreciated.
 
Try using CDbl([RealAmt]) in your query rather than simply [RealAmt]

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



teddyb777 said:
I have four tables that have the same columns and data types (4 different
fiscal years data). I have a union query that combines the information into
one table using UNION ALL. Then I am querying the Combined table, but I am
having trouble because it says that my number fields are text. I have a
field called RealAmt that is a Double Number data type in all four tables
that are unioned. When I try to write criteria to query that combined field
(RealAmt >0 and <100) it turns it into (RealAmt >"0" and <"100") so my
results are incorrect. Any help would be appreciated.
 
Back
Top