specify data type in union query

  • Thread starter Thread starter Pat Wright
  • Start date Start date
P

Pat Wright

I have a Union Query from tables imported from Excel.
How can I have the Union query import the fields in
anything but text values? I need a currency and a date
field.

Thank you,

Pat Wright
 
In the UNION query statement, you could typecast the data, e.g.:
SELECT CCur([SomeThing]) As MyThing,
CVDate([AnotherColumn]) As MyColumn, ...

The typecasting would need to be present in each SELECT statement of the
UNION query. Since CCur() cannot accept nulls, you may also need to use Nz()
inside CCur().

It may be easier to import the data into a temp table, running a series of
Append query statements rather than a UNION to grab them all at once. It is
then very easy to massage the data and Append it to the real table.
 
Back
Top