specify data type in union query

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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top