R
rolaaus
I did some searches on this problem before trying to post here to the
newsgroup, but what little information I found did not seem to help.
Here is the problem. I have a UNION query that joins 2 queries into 1
dataset. Each sub-query works fine individually, but when I place them into
a UNION query it gives the error message "Data Type mismatch in criteria
expression"
I first double-checked to make sure any JOIN fields were of the same data
type - which they are (everything is in TEXT format). Also, the information I
found suggested there might be problems when an empty field is used in one of
the JOIN fields, so I eliminated those for troubleshooting purposes, and I
still get the problem.
the last thing I tried was changing all types of JOINS (inner vs. outer). I
first made all of the joins only show fields that matched, then I made them
show any record that matched the main table I need, and only those in the
JOIN that matched - and I did this for both sub-queries, but still no joy.
Any suggestions would be greatly appreciated - especially since I don't seem
to have this problem before I converted every field in every table to TEXT -
you see, I am importing some data from Excel, and you know how Access will
"guess" what the field type should be based on the first several rows of data
in Excel, well, I wanted everything to be imported without any probelms, so I
forced Access (through VBA + automation) to import the Excel file as strictly
text. Before I did this, my join query worked just fine (go figure). But
now, every field in every table is TEXT size 255.
newsgroup, but what little information I found did not seem to help.
Here is the problem. I have a UNION query that joins 2 queries into 1
dataset. Each sub-query works fine individually, but when I place them into
a UNION query it gives the error message "Data Type mismatch in criteria
expression"
I first double-checked to make sure any JOIN fields were of the same data
type - which they are (everything is in TEXT format). Also, the information I
found suggested there might be problems when an empty field is used in one of
the JOIN fields, so I eliminated those for troubleshooting purposes, and I
still get the problem.
the last thing I tried was changing all types of JOINS (inner vs. outer). I
first made all of the joins only show fields that matched, then I made them
show any record that matched the main table I need, and only those in the
JOIN that matched - and I did this for both sub-queries, but still no joy.
Any suggestions would be greatly appreciated - especially since I don't seem
to have this problem before I converted every field in every table to TEXT -
you see, I am importing some data from Excel, and you know how Access will
"guess" what the field type should be based on the first several rows of data
in Excel, well, I wanted everything to be imported without any probelms, so I
forced Access (through VBA + automation) to import the Excel file as strictly
text. Before I did this, my join query worked just fine (go figure). But
now, every field in every table is TEXT size 255.